Sign in to follow this  

[Solved] C++ template problem

This topic is 3843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a problem in my code which involves templates. Visual Studio compiles it just fine but GCC 4 complains in the line where I do func = &A<Derived>::func_template<x>; Following is a small piece of code that produces the problem. What am I doing wrong? I can't seem to find a solition!
template <typename Derived>
struct A {
	void (A::*func)();
	
	template <int x>
	void test()
	{
		func = &A<Derived>::
			func_template<x>;
	}
	
	template <int x>
	void func_template()
	{}
};


[Edited by - Trenki on June 9, 2007 7:13:44 AM]

Share this post


Link to post
Share on other sites

This topic is 3843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this