Jump to content
  • Advertisement
Sign in to follow this  
Brobanx

VC.NET 2003 can't handle partial specialization of templates?

This topic is 5036 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 the following test code:
template <class A, class B>
class Jack { };

template <class B>
class Jack<B, int>{};

int main() {
}

In VC.NET 2003, this fails to compile. I thought VC 2003 supported partial specialization, however. The exact error messages are: error C2065: 'B' : undeclared identifier [line 4] error C2687: cannot define a nested UDT of a template class out of line [lines 5]

Share this post


Link to post
Share on other sites
Advertisement
AFAIK, 2002 doesn't support but 2003 does. And that's the right syntax, I'm pretty sure. Try

template <class A>
class Jack<A, int>{};

Share this post


Link to post
Share on other sites
Quote:
Original post by Brobanx
I have the following test code:

*** Source Snippet Removed ***

In VC.NET 2003, this fails to compile. I thought VC 2003 supported partial specialization, however. The exact error messages are:

error C2065: 'B' : undeclared identifier [line 4]
error C2687: cannot define a nested UDT of a template class out of line [lines 5]

It should compile perfectly fine in .net 2003. Your errors might be caused by some other code you're not including in the post (I'm betting you missed an end curly bracket somewhere).

Share this post


Link to post
Share on other sites
Ach, I feel so stupid. I let the VC.net 2002 compiler have a higher precedence in the environment PATH.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!