Boost logo

Boost :

From: Mat Marcus (mmarcus-boost_at_[hidden])
Date: 2003-09-02 12:36:27


We're trying to use optional from 1.30.0 (sorry legal hasn't approved
our use of 1.30.2 yet). However on one compiler (Metrowerks 8.3 PPC
CFM) we're getting static asserts from the alignment calculation
metafunctions. Below is an abstracted example of the problem. I'm
curious about what's going on and what workarounds might be possible.

Thanks,
Mat

#include <utility>
#include "boost/optional.hpp"

boost::optional<std::pair<double, double> > foo;

/*
Error : illegal use of incomplete struct/union/class
'boost::STATIC_ASSERTION_FAILURE<0>'
 (instantiating: 'boost::optional<std::pair<double, double>>')
  (instantiating:
'boost::optional_detail::aligned_storage<std::pair<double, double>>')
   (instantiating:
'boost::optional_detail::aligned_storage<std::pair<double,
double>>::dummy_u')
    (instantiating: 'boost::type_with_alignment<8>')
type_with_alignment.hpp line 109 BOOST_STATIC_ASSERT(found >= Align);

Error : illegal use of incomplete struct/union/class
'boost::STATIC_ASSERTION_FAILURE<0>'
 (instantiating: 'boost::optional<std::pair<double, double>>')
  (instantiating:
'boost::optional_detail::aligned_storage<std::pair<double, double>>')
   (instantiating:
'boost::optional_detail::aligned_storage<std::pair<double,
double>>::dummy_u')
    (instantiating: 'boost::type_with_alignment<8>')
type_with_alignment.hpp line 110 BOOST_STATIC_ASSERT(found % Align
== 0);

*/


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