Boost logo

Boost :

From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2005-02-25 09:02:25


"Jody Hagins" <jody-boost-011304_at_[hidden]> escribió en el mensaje
news:20050224111940.72092ff7.jody-boost-011304_at_atdesk.com...
> On Thu, 24 Feb 2005 12:57:51 -0300
> "Fernando Cacciola" <fernando_cacciola_at_[hidden]> wrote:
>
>> Hi people,
>>
>> In the users mailing list, Yuval Ronen pointed out that optional<>
>> uses a type "detail::none_t", documented as such, thus prompting
>> people to use a type in a namesapece which is supposed to be hidden to
>> end users. A straightforward fix is to just move "none_t" out of the
>> detail namespace directlty into boost.
>> However, this little change introduces a new type in the (main) boost
>> namespace, so before I do that I want to make sure it won't have any
>> undesired impact.
>>
>> If you see any reason for not doing this (putting "none_t" right there
>> in boost) please speak now.
>>
>> If no one objects, I'll do it.
>
>
> What is wrong with using the "none" instance, ala...
>
Nothing :-)

But "none" happens to be an instance of "detail::none_t", so Optional's
interface speaks of "detail::none_t", thus anyone can use that type directly
with it's own instance.

IOW, the fact that the recommended usage is to use the precanned instance
"none" doesn't mean that it is correct for the type of this instance to be
in a private namespace. That would imply that users are only allowed to use
that instance, which is not the case; and couldn't anyway even if I wanted
to.

Best

Fernando Cacciola


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