Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-08-30 03:30:59

1. Someone just pointed out to me that the compressed_pair docs mention the
"empty member optimization". Shouldn't that be "empty base optimization",


2. I was recently trying to use compressed_pair with a type that was not
copy-constructible under gcc-3.0, but a type_traits problem prevents it:

#include <boost/compressed_pair.hpp>

struct X

struct Y : boost::compressed_pair<X,X> { Y(); };

int main()
    Y y;


boost/type_traits/object_traits.hpp: In instantiation of
boost/type_traits/object_traits.hpp:240: instantiated from
`boost::detail::empty_helper<X, true, false>'
boost/type_traits/object_traits.hpp:258: instantiated from
foo.cpp:8: instantiated from `boost::compressed_pair<X, X>'
foo.cpp:8: instantiated from here
boost/type_traits/object_traits.hpp:225: base `X' with only
   non-default constructor in class without a constructor


I'm guessing that Howard's fix below was not for a compiler bug, but a
library bug after all? In any case could it hurt to take off the #ifdef

template <typename T>
struct empty_helper_t1 : public T
#ifdef __MWERKS__
   empty_helper_t1(); // hh compiler bug workaround
   int i[256];


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