boost::optional - Include none.hpp instead of none_t.hpp?

Was it intentional to include none_t.hpp instead of none.hpp in boost/optional.hpp? Otherwise it seems that the user must resort to including boost/detail/none.hpp

<Schalk_Cronje@NAI.com> escribió en el mensaje news:2E22904642859A40AF5E1CA1597EBB1F12FF25@devexmb1.corp.nai.org...
Was it intentional to include none_t.hpp instead of none.hpp in boost/optional.hpp? Otherwise it seems that the user must resort to including boost/detail/none.hpp
Well, yes, it was. The reason is that the Borland compiler (at least BCB6) refuses to create a precompiled header with data on it, not even pointer constants. Therefore, none.hpp cannot be in a precompiled header (PCH); and any header including it won't be allowed in a PCH. As I see optional<> as ubiquitous, I decoupled none.hpp from it so that Optional users (specially for BCB) can put it in a PCH. The drawback is that users wanting to use "none" must include it separately. Now, OTOH, I think "none.hpp" should leave in the root directory and not on detail. I initially put it there but some people argued that it was Optional specific, but since there is no /optional subdir I moved it into /detail Fernando Cacciola SciSoft

"Fernando Cacciola" <fernando_cacciola@hotmail.com> writes:
Now, OTOH, I think "none.hpp" should leave in the root directory and not on detail. I initially put it there but some people argued that it was Optional specific, but since there is no /optional subdir I moved it into /detail
FWIW, that was the wrong choice. /detail is supposed to be for implementation details, and users of documented components should never be tempted to go there. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

"David Abrahams" <dave@boost-consulting.com> escribió en el mensaje news:ur7sxancu.fsf@boost-consulting.com...
"Fernando Cacciola" <fernando_cacciola@hotmail.com> writes:
Now, OTOH, I think "none.hpp" should leave in the root directory and not on detail. I initially put it there but some people argued that it was Optional specific, but since there is no /optional subdir I moved it into /detail
FWIW, that was the wrong choice. /detail is supposed to be for implementation details, and users of documented components should never be tempted to go there.
OK... these are the choices then AFAICS: (1) Put in directly on /boost (2) Put in a new directory /boost/optional even if it will contain only this file (3) Put in /boost/optional, move "optional.hpp" here, and retain a root "optional.hpp" stub for backward compatibility. I'll go for (1) since it is possible, if not likely, that variant<> uses "none.hpp" too. Opinions? Fernando Cacciola SciSoft
participants (3)
-
David Abrahams
-
Fernando Cacciola
-
Schalk_Cronje@NAI.com