Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-04-10 13:10:11

"Douglas Gregor" <gregod_at_[hidden]> wrote in message
> On Tuesday 09 April 2002 10:27 am, you wrote:
> > The latest alignment_traits is broken on borland 5.5.1 and 5.6. I have
> > tried finding a fix but have not come up with anything. Can anyone help
> > please.
> >
> > Error E2231 c:\usr\boost\boost/type_traits/alignment_traits.hpp 183:
> > type_with_alignment<Align>::t1_aligned cannot be used without an object
> This problem is now fixed for all compilers I was able to easily test:
> Borland C++ 5.5.1, MSVC 6.0sp5, and GCC 2.95.3.
> Doug


BTW, the typedef 'this_type' which I introduced in my fix just in order to
use ctv_warp<> is not needed anymore... But you have left it in the code:

template <int Align>
class type_with_alignment
  typedef detail::lower_alignment<Align> t1;

  typedef type_with_alignment<Align> this_type; // <==============

  typedef typename detail::ct_if<
              (detail::is_aligned<(alignment_of<t1>::value), Align>::value)
            , t1
            , detail::max_align
>::type align_t;

  BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of<align_t>::value);

  BOOST_STATIC_ASSERT(found >= Align);
  BOOST_STATIC_ASSERT(found % Align == 0);

  typedef align_t type;

(NOTE: I needed to write the extra typedef because bcb didn't liked
"ctv_wrap< type_with_alignment<Align> >" directly)

Fernando Cacciola
Sierra s.r.l.

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