Boost logo

Boost :

Subject: Re: [boost] [optional] How to define boost::none?
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2014-11-19 11:09:26


2014-11-19 16:58 GMT+01:00 Andrzej Krzemienski <akrzemi1_at_[hidden]>:

>
>
> 2014-11-19 16:43 GMT+01:00 Peter Dimov <lists_at_[hidden]>:
>
>> Andrzej Krzemienski wrote:
>>
>>> 2014-11-19 16:28 GMT+01:00 Krzysztof Czainski <1czajnik_at_[hidden]>:
>>> > And then, why wouldn't a straightforward solution work:
>>> >
>>> > struct none_t {};
>>> >
>>> > none_t const none = {}
>>>
>>> I think it validates ODR, or doesn't it?
>>>
>>
>> It does violate ODR at places (without any ill effects AFAIK). Bind's
>> placeholders have the same problem.
>
>
> Hmm, looks like an option (although technically this is an UB)
>

But, what would be a practical recommendation for my problem?
Is having a "benign" UB like the above an acceptable solution for a Boost
library?


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