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: Larry Evans (cppljevans_at_[hidden])
Date: 2010-05-11 08:05:18


On 05/10/10 20:33, Lubomir Bourdev wrote:
[snip]
> 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.
[snip]
Did you figure out the reason for the compile time penalty.
Looking at boost/gil/extension/dynamic_image/variant.hpp
around line 94, I see:

     typedef struct { char data[MAX_SIZE]; } base_t; // empty space
        //equal to the size of the largest type in Types

So, I assume no alignment calculations are made. Would the alignment
calculations be the main cause of the compile time penalty?
The alignment calculations I'm talking about are those done by
make_storage in boost/variant/variant.hpp at around line 218.
I assume gil doesn't need any alignment calculations because all
alignments required by the gil variant components are 1. Is that
right?

TIA.

-regards,
Larry


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