Sent from my iPhone

On May 20, 2010, at 5:43 AM, "Peter Dimov" <pdi...@pdimov.com> wrote:

Paolo Carlini wrote:
On 05/20/2010 02:18 PM, Peter Dimov wrote:
On 05/20/2010 01:55 PM, Paolo Carlini wrote:
It's uglier because the code above doesn't work for functions,

By the way, do you have a specific testcase in mind?

Because addressof_fn_test.cpp, part of Boost, passes...

This is probably a g++/gcc extension... some compilers do not allow
references to functions to be casted to char&, and I believe the
standard doesn't permit that, either.
I see. I'm a bit reluctant to add complexity to the code, given that
current Comeau and Intel, at least, in strict-mode, also like it...

If it works, there's certainly no need to add complexity.

Here's the ticket that prompted the boost::addressof changes:

https://svn.boost.org/trac/boost/ticket/1846

but it doesn't say which compiler didn't like it at the time. MSVC 8.0 also does.



I do know at one point gcc changed to reject it by default and then that was reverted as it broke building libjava; not to mention most uses of dlsym.

Thanks,
Andrew Pinski

Reply via email to