From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2004-11-09 10:00:48
On Tue, 9 Nov 2004 09:38:35 -0500
Caleb Epstein <caleb.epstein_at_[hidden]> wrote:
> I'm stumped by how to store this information in any sort of container
> though, since the properties are of different types. Any thoughts, or
> is this madness?
If I understand what you are asking, I have been using a "type index"
container for a while. However, my solution depends on using static
data members of a template class. Specifically, I have a mechanism that
assigns a unique runtime integral value to each type, and then that
value is used to index into a vector or map of boost::any, and then
since it "knows" the type, a cast is performed to the appropriate type.
Does that sound like what you are asking about, or am I out to lunch?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk