|
Boost : |
Subject: Re: [boost] [variant] Warning: variadic templates in boost::variant
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-12-11 00:52:27
On Wed, Dec 11, 2013 at 8:30 AM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> AMDG
>
> On 12/10/2013 06:57 PM, Andrey Semashev wrote:
>> On Tuesday 10 December 2013 23:13:32 Peter Dimov wrote:
>>>>> template< typename T0 = blank, typename... TN >
>>>>> class variant;
>>>
>>> Mapping variant<> to variant<blank> is not a good idea in principle. This
>>> has the potential of creating endless loops in generic code that takes
>>> variant<T, U...> and recursively calls itself with variant<U...>.
>>
>> But such code is currently not valid, it should end the recursion at
>> variant<T>. This doesn't change after the default is added.
>>
>
> So, anyone writing such a loop has
> to treat variant<> as a special case.
> That doesn't seem like the greatest idea.
Ok, we can allow variant<> in recursion but still make it act like
variant<blank>.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk