Boost logo

Boost Users :

Subject: Re: [Boost-users] [GIL] does gil::variant<mpl::vector3<A, B, C> > constructor accept instances of gil::variant<mpl::vector2<A, B> > ?
From: Lubomir Bourdev (lbourdev_at_[hidden])
Date: 2010-05-10 21:33:23


Nicolas Lelong wrote:
>does gil::variant<mpl::vector3<A, B, C> > constructor accept instances of gil::variant<mpl::vector2<A, B> > ?
>...
>Anyone could tell me what is the rationale behind having a special variant for boost::gil ? performance ? Wouldn't it be easier to replace it by boost::variant ?

Hi Nicolas,

It was not possible to assign and copy construct between two gil::variants containing different subsets of types.
I just submitted and update that makes this possible so you should sync to trunk.

As for why we don’t use boost::variant, I recall that I was able to switch to boost::variant at some point (it wasn’t that hard) but there was a severe compile time penalty.
Another reason is that gil::variant takes a single type, which is an MPL random access container of types, whereas boost::variant takes the types directly. The former makes a lot of operations easier.

Lubomir



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