Boost logo

Boost Users :

Subject: Re: [Boost-users] [MPL] return type
From: Istvan Buki (buki.istvan_at_[hidden])
Date: 2011-10-11 08:15:14


On Mon, Oct 10, 2011 at 11:49 PM, Dave Abrahams <dave_at_[hidden]> wrote:

>
> on Mon Oct 10 2011, Igor R <boost.lists-AT-gmail.com> wrote:
>
> >> Yeah, as long as you're doing that with a runtime test, your only option
> >> is to use some kind of type erasure (boost::any, polymorphic base class,
> etc).
> >
> > Or Boost.Variant.
>
> (which is what I meant by etc.)
>
> I think if you are going to use type erasure, Igor's suggestion is
> probably the approach most suited to a metaprogrammed system.
>
>
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...



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net