Boost logo

Boost :

Subject: Re: [boost] [variant] Please vote for behavior
From: Joel de Guzman (djowel_at_[hidden])
Date: 2013-01-29 00:20:47

On 1/29/13 11:18 AM, Larry Evans wrote:
> On 01/28/13 16:12, Joel de Guzman wrote:
>> On 1/29/13 5:58 AM, Gottlob Frege wrote:
>>>>> How do I know if is it singular valued?
>>>>> How do you know if an iterator is singular valued? You can't. Same
>>>> here.
>>> it == container.end()?
>>> Or am I confused?
>> Nope. A singular valued iterator may not be compared. A singular
>> valued iterator is not associated with any sequence. E.g default
>> constructed iterator pointing to nowhere.
>> Regards,
> Why impose the same limitation on recursive_wrapper<T>. Just because
> the current variant visitor requires the recursive_wrapper<T> to be
> dereferenced doesn't mean that's the best practice. Why not, as
> suggested previously, the visitor protocol allow:
> operator()(recursive_wrapper<T>const&)
> and, for that matter have get<T> return a recursive_wrapper<T>&
> or recursive_wrapper<T>const&.
> The current variant doesn't do that for, I guess, convenience reasons;
> however, as evidenced by the current *long* discussion, that convenience
> is illusory, IMHO.
> Such a proposal was made previously here:

AFAICT, you can already do that with any smart pointer (e.g. unique_ptr<T>)


Joel de Guzman

Boost list run by bdawes at, gregod at, cpdaniel at, john at