Boost logo

Boost :

Subject: Re: [boost] [review][constrained_value] Review of ConstrainedValueLibrary begins today
From: John Maddock (john_at_[hidden])
Date: 2008-12-04 04:32:56

Robert Kawulak wrote:
>> Hi John,
>>> However, I did notice that the empty-base-optimisation has
>>> been incorrectly
>>> applied - so for example sizeof(bounded_int<int, 0,
>>> 100>::type) is 8 when
>>> compiled with msvc (ie even with EBO support).
>> AFAICT the EBO support is tuned fine and on GCC it works as
>> expected. I too was getting a bit worse results with MSVC, but I
>> suspect this is rather the fault of MSVC. However, if I missed
>> something, I'd be grateful for pointing me to the place which is the
>> problem.

At present you have:

compressed_pair<empty1, empty2> member1;
T member2;

Whether or not "member1" is treated as empty by the compiler depends upon
the ABI used.

If you used a single data member consisting of nested compressed_pair's:

   compressed_pair<definitely_not_empty, maybe_empty1>,
   maybe_empty2> single member;

Then you would get EBO on more compilers IMO.

>>> But... no documentation on the concepts used by the library,
>>> and of course
>>> suitable concept archetypes should be used to test the library.
>> Which concepts do you have in mind -- the policies or things like
>> CopyConstructible? The policies are described in the documentation of
>> constrained class template. Did I miss something there?

I was thinking of the interface required to be provided by the
constraint-checking and error-handling template parameters, perhaps I missed
it? I realise it was mostly covered by the examples/tutorial, but I didn't
see a reference page for these?

Cheers, John.

Boost list run by bdawes at, gregod at, cpdaniel at, john at