Jump to content
  • Advertisement
Sign in to follow this  
M4573R

Keeping track of templated classes

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

Is there a way to keep a list of templated classes? I'm attempting to write my own configuration file system. I'll be parsing configuration files for keywords such as "int" "float" etc. So when I'm parsing a file I want to be able to create a templated variable class "Variable<int>" and "Variable<float>". This isn't hard, but how can I keep a list of all of these when I cannot use a templated class as a list type?

Share this post


Link to post
Share on other sites
Advertisement
Ah, of course. Thanks. I resorted to just parsing floats because I can't think of any way to create user-defined types with a script. I can't imagine including every file in my game that has a type definition in it and hard coding a string to match every single user type.

Share this post


Link to post
Share on other sites
Quote:
Original post by M4573R
I resorted to just parsing floats

Beware, most integer values cannot be represented by floats. Have you tried parsing the integer 123456789 as a float for example? ;)

Share this post


Link to post
Share on other sites
Hm, I guess I could just parse everything as strings and let the end user be responsible for converting it to the right type.

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!