Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-09 08:33:16


I like it! You can either:

1. submit a patch (including docs and a test). I will gladly integrate
it.
2. Work with Douglas, who I believe has CVS access.

Thanks,
Dave

----- Original Message -----
From: "Brad King" <brad.king_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, April 03, 2002 1:41 PM
Subject: [boost] address_of implementation

> Hello,
>
> During the discussion of possible new C++ features, I think someone
> mentioned an "addressof()" feature that would give the real address of
> an object even if it overloads operator&(). Doug Gregor and I
> recently realized that it may be possible to implement this in a
> library.
>
> Ignoring cv-qualifiers, this may work:
>
> template <typename T>
> T* address_of(T& v)
> {
> struct address_of_helper {};
> return
reinterpret_cast<T*>(&reinterpret_cast<address_of_helper&>(v));
> }
>
> The relevent paragraph in the '98 standard appears to be 5.2.10/10.
If
> this indeed will work, it may be worth adding to boost, perhaps in
> boost/utility.hpp.
>
> Thoughts?
> -Brad
>
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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