Boost logo

Boost :

Subject: Re: [boost] Review Request: impl_ptr (pimpl)
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2017-08-22 21:57:20


On Tue, Aug 22, 2017 at 5:41 PM, Gary Furnish wrote:
> You can then use std::address_of(*raw memory) to get the raw memory address.

addressof(*p) to construct an object (e.g. via placement new or via an
allocator) is undefined if p points to storage without an object
constructed in it. It is the reason libstdc++, libc++, Boost use
to_raw_pointer(), to_address() functions). See P0653r1.[1]

boost::to_address(p) instead should be fine.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0653r1.html


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