on Tue Oct 11 2011, Istvan Buki
Thank you for your suggestions.
It seems that one way or the other I'll have to bite the bullet and use (at least partially) a more traditional approach in my application. It all started when I saw that to avoid duplicating information among my classes I created a complex inheritance hierarchy. I didn't like it and I decided to try using some generative programming techniques to build my classes at compile-time. So far so good but then I was facing all kind of other problems like how to store these heterogeneous objects in containers or, like in the example above, mix run-time and compile-time tests...
Well, boost::variant is very well-suited to these problems. -- Dave Abrahams BoostPro Computing http://www.boostpro.com