
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