Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-11-15 16:48:02

From: "Douglas Gregor" <gregod_at_[hidden]>
> Just to spell it out in agonizing detail, so we can look for any holes in
> logic:
> template <typename T> T* addressof(T& v)
> {
> return reinterpret_cast<T*>(
> &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
> }

The only hole is that the above doesn't work for function types, but you
probably know that. :-)

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