Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2000-08-11 19:57:34


I have a problem trying to use functional.hpp that comes from the
type_traits.hpp header it (indirectly) #include-s.

The error is

> Error : illegal use of incomplete struct/union/class
> 'boost::alignment_of::padded'
> type_traits.hpp line 500 static const unsigned value = sizeof(padded) -
> sizeof(T);

The given line is the last line of this class

> // get the alignment of some arbitrary type:
> template <class T>
> class alignment_of
> {
> struct padded
> {
> char c;
> T t;
> padded();
> };
> public:
> static const unsigned value = sizeof(padded) - sizeof(T);
> };

with the "-" character highlighted.

I'm using Metrowerks CodeWarrior Pro 5 (with 5.3 update) on Mac OS 9. The
error is a showstopper, the compiler doesn't even bother to report any other
possible errors. I need some way to use functional.hpp, since its binders
don't have the reference-to-references problem. (I want to use the standard
algorithms for the classes Thant Tessman mentioned.)

-- 

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