Boost logo

Boost :

From: Michael Shepanski (mshepanski_at_[hidden])
Date: 2005-10-25 20:18:08


 The code below fails a compile-time assertion in boost 1.32.0 on MSVC 7.1.

This is because, internally, boost::optional uses boost::alignment_of, which
produces the number 12, which is then passed as a template parameter to
boost::type_with_alignment, which won't accept 12.
 Not sure where the blame lies. Is it with boost::alignment_of, for
producing
12 in the first place? Perhaps not, since 12 is a multiple of 4, and the
doco
says boost::alignment_of is allowed to produce any multiple of the actual
alignment value. So is the fault with boost::type_with_alignment, for not
accepting 12? Or is there something wrong with the app?
  #include <boost/optional.hpp>

class D
{
virtual ~D();
};

class E : virtual public D
{
virtual ~E();
unsigned long long m_i;
};

boost::optional<E> s_optE;

Cheers,
--- Michael Shepanski


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk