Jump to content
  • Advertisement
Sign in to follow this  
mvtapia

managed template class

This topic is 4494 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

Hello everyone, I have a problem with managed c++. I've been trying to convert a template class I have to managed and can't seem to crack it. does anybody know how to do it. template< class Type > class LinkedList { } I've tryied putting __gc everywhere with out success... Please help me. thanks

Share this post


Link to post
Share on other sites
Advertisement
I've been looking around and tha was the same thing I found around. this is a quote from a forum I found

Quote:

In general, it's simply not possible: Generics are a runtime mechanism
implemented by the CLR. Templates are a compile time mechanism implemented
by the C++ compiler. There's simply no way the CLR can instantiate a
template based on the generic type parameter(s) - only the C++ compiler can
do that.


It seem to be really bad. Looks like managed C++ is great for gui and stuff like that but for anything else I'ts just doesn't cut it. kind of reduces the power of c++

Share this post


Link to post
Share on other sites
Quote:
Original post by mvtapia
It seem to be really bad. Looks like managed C++ is great for gui and stuff like that but for anything else I'ts just doesn't cut it. kind of reduces the power of c++

Generics are plenty powerful, you're just being short sighted. C++/CLR is a completely different language, and you shouldn't expect everything to work exactly the same.

CM

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!