|
Boost : |
From: Fabrice Truillot (fte_at_[hidden])
Date: 2000-08-04 00:26:53
on 4.8.2000 6:31, Fabrice Truillot at fte_at_[hidden] wrote:
> The truth is elsewhere.
OK. I don't fully understand what's wrong with CodeWarrior, but the
following hack compile without errors or warnings :
template <class T>
class alignment_of_hack
{
public:
struct padded
{
char c;
T t;
padded();
};
};
template <class T>
class alignment_of
{
public:
static const unsigned value =
sizeof(typename alignment_of_hack<T>::padded) - sizeof(T);
};
template <class T>
class alignment_of<T&>
{
public:
static const unsigned value = alignment_of<T*>::value;
};
There is a parser bug somewhere...
-- Fab'
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk