This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52768] Unable to get pointer to template function
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Mar 2012 13:02:14 +0000
- Subject: [Bug c++/52768] Unable to get pointer to template function
- Auto-submitted: auto-generated
- References: <bug-52768-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52768
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-29 13:02:14 UTC ---
(In reply to comment #0)
> The code to explain the problem is:
No it isn't, it's missing several include files. I know it's "obvious" which
ones they are, but if five different people all look at the bug report and try
to reproduce the behaviour then they all have to figure it out and modify the
code. You'd save everyone time by providing a *complete* testcase, as clearly
requested by the bug submissions guidelines.
A complete example would be:
template<typename Res>
struct function
{
template<typename F> function(F) { }
};
template <class T>
struct Creator
{
template <typename...Ts>
static T* create(Ts&&... vs)
{
return new T(vs...);
}
};
class Car:
public Creator<Car>
{
private:
friend class Creator<Car>;
Car() { }
};
int main()
{
function< Car* () > createFn=&Car::create<>;
}