Generic Container

Started by
21 comments, last by Zipster 21 years, 7 months ago
I'm sorry, I did read your post, but just completely forgot to reply to it Sorry again...

Anyway, your solution sounds like it would work pretty good. A few questions though. How exactly are you overloading your functions and operators in your derived templated classes? To use the pure virtual Read function from the Attribute* class, you can't overload return types or parameter types (at least I don't think)... so how is the correct type set via the = operator (that's where I'm assuming it converts the Mem1FromFile Attribute* pointer to the correct value type to store in member1)?

I'm just confused how you are overloading these things, as in the pure virtual base class you pretty much have to have the types filled in, namely for the Read function, right? This whole construct is what I was trying to get at from my original thought all the way in post 1, but I couldn't figure out how to go about setting this up.

[edited by - Zipster on September 17, 2002 2:36:28 AM]
Advertisement
You don''t need to link to anything specific to use boost::any, as it only depends on a few header files (any.hpp and the configuration headers that ensure portability), which you could very well ship with your application.

If you want to reimplement it yourself, you might as well have a look at how it works.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
That''s the thing, I don''t need a full reimplementation of it - that and I doubt I''d be able to understand what the heck was going on in the boost::any code besides AP seems to be on the right track, and he says his system works for him, which is a good thing

This topic is closed to new replies.

Advertisement