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