[C++-sig] Re: Mac OS 10 & type_with_alignment.hpp

David Abrahams dave at boost-consulting.com
Thu May 22 17:22:07 CEST 2003


"Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com> writes:

> It's failing while compiling this file (will not be removed any time soon):
>
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cctbx/scitbx/array_family/boost_python/flex_histogram.cpp?rev=1.1&content-type=text/vnd.viewcvs-markup
>
> I put back this (and only this) assertion:
>
>      BOOST_STATIC_ASSERT(found >= Align);
>
> The preprocessor output and the compiler error messages are here:
>
> http://cci.lbl.gov/~rwgk/tmp/fh1.cpp
> http://cci.lbl.gov/~rwgk/tmp/fh1.g++_errors
>
> I put back this (and only this) assertion:
>
>      BOOST_STATIC_ASSERT(found % Align == 0);
>

After passing this through Leor Zolman's STLFilt.pl script to make the
long messages readable (love that script!), I see that it's having a
problem deducing the alignment of your histogram class.

Could you make the following patch to
boost/type_traits/type_with_alignment.hpp just to see what happens?

change:

    class alignment_dummy;
    typedef void (*function_ptr)();
    typedef int (alignment_dummy::*member_ptr);
    typedef int (alignment_dummy::*member_function_ptr)();

    #define BOOST_TT_ALIGNMENT_TYPES BOOST_PP_TUPLE_TO_LIST( \
            11, ( \
            char, short, int, long, float, double, long double \
            , void*, function_ptr, member_ptr, member_function_ptr))

to:

    class alignment_dummy {};
    typedef void (*function_ptr)();
    typedef int (alignment_dummy::*member_ptr);
    typedef int (alignment_dummy::*member_function_ptr)();

    #define BOOST_TT_ALIGNMENT_TYPES BOOST_PP_TUPLE_TO_LIST( \
            11, ( \
            char, short, int, long, float, double, long double \
            , void*, function_ptr, member_ptr, member_function_ptr, alignment_dummy))


[all changes in 1st and last lines]

Thanks!
-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list