Jason Merrill wrote:
On 05/20/2010 08:18 AM, 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 p
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
On 05/20/2010 08:18 AM, 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 exte
Sent from my iPhone
On May 20, 2010, at 5:43 AM, "Peter Dimov" 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 i
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 p
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 probabl
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
refere
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...
Paolo.
Hi,
>>> ... for reference, it would be something like this (in my
>>> recollections,
>>> it was even uglier ;)
>>>
>>> template
>>> _Tp*
>>> addressof(_Tp& __v)
>>> {
>>> return reinterpret_cast<_Tp*>
>>> (&const_cast(reinterpret_cast>> char&>(__v)));
>>> }
> It's uglier because t
On 05/20/2010 01:10 PM, Paolo Carlini wrote:
... for reference, it would be something like this (in my recollections,
it was even uglier ;)
template
_Tp*
addressof(_Tp& __v)
{
return reinterpret_cast<_Tp*>
(&const_cast(reinterpret_cast(__v)));
}
It's uglier because the code a
On 05/20/2010 01:10 PM, Paolo Carlini wrote:
> ... for reference, it would be something like this (in my recollections,
> it was even uglier ;)
>
> template
> _Tp*
> addressof(_Tp& __v)
> {
> return reinterpret_cast<_Tp*>
> (&const_cast(reinterpret_cast(__v)));
> }
>
By the way
... for reference, it would be something like this (in my recollections,
it was even uglier ;)
template
_Tp*
addressof(_Tp& __v)
{
return reinterpret_cast<_Tp*>
(&const_cast(reinterpret_cast(__v)));
}
I'm not sure...
Paolo.
Hi,
among the support facilities required by C++0x there is:
//
20.9.9.1 addressof [specialized.addressof]
template T* addressof(T& r);
1 Returns: the actual address of the object or function referenced by r,
even in the presence of an
overloaded operator&.
Throws: nothing.
13 matches
Mail list logo