This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Implementing addressof for C++0x


On 05/20/2010 08:13 PM, Jason Merrill wrote:
> The standard permits a compiler to accept or reject such a cast.
>
> 5.2.10/8: Converting a pointer to a function into a pointer to an
> object type or vice versa is conditionally-supported.  The meaning of
> such a conversion is implementation-defined, except that if an
> implementation supports conversions in both directions, converting a
> prvalue of one type to the other type and back, possibly with
> different cv-qualification, shall yield the original pointer value.
Thanks for the clarification.

The library patch which I'll commit later today includes a very simple
implementation of std::addressof - essentially what I posted already at
the beginning of this thread - and a specific testcase making sure that
we can deal correctly with functions: if, for some reason, the compiler
changes in the future about this issue, we can immediately notice and
adjust std::addressof.

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]