none_t in the boost namespace

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. Best, Fernando Cacciola

On Thu, 24 Feb 2005 12:57:51 -0300 "Fernando Cacciola" <fernando_cacciola@hotmail.com> 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... #include <boost/optional.hpp> #include <boost/none.hpp> int main(int, char *[]) { boost::optional<int> x(boost::none); return 0; }

"Jody Hagins" <jody-boost-011304@atdesk.com> escribió en el mensaje news:20050224111940.72092ff7.jody-boost-011304@atdesk.com...
On Thu, 24 Feb 2005 12:57:51 -0300 "Fernando Cacciola" <fernando_cacciola@hotmail.com> 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
participants (2)
-
Fernando Cacciola
-
Jody Hagins