Boost logo

Boost :

Subject: Re: [boost] [reference_wrapper] Overloading operator() inreference_wrapper
From: Nathan Crookston (nathan.crookston_at_[hidden])
Date: 2013-05-02 11:10:41


Hi all,

Peter Dimov wrote:

> Kazutoshi Satoda wrote:
>
>> The standard version has 4 member typedef which are conditionally
>> defined: result_type, argument_type, first_argument_type,
>> second_argument_type. If "to update boost::ref to match the standard
>> version" includes addition of these members, it requires the argument
>> type complete to determine the condition to (or not to) define these
>> typedef. If you decide not to define these typedef based on the
>> incompleteness, it will likely cause ODR violation.
>>
>
> Interesting. I've always considered these typedefs redundant, but this is
> the first time I see them as actively harmful.
>

Yes, this is good to know. I wondered why the standard bothered to specify
that in our new, decltype-enabled world. I'll update the ticket to
reference this discussion. Happily, just having an operator() overload
shouldn't require completeness.

Thanks,
Nate


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