Deciding what to put in `namespace detail`

For my future Boost.RDB submission, I feel tempted to put everything except the names that are in the public (documented) interface in a nested `namespace detail`. Why not even put *everything* there and copy selected names in the public namespace by means of using-declarations. Has it been already done ? And what about having three namespaces : a "public" one for the user, a "protected" one for those extending the lib, and a "private" one for undocumented internals? Opinions and advise welcome... J-L

AMDG Jean-Louis Leroy wrote:
For my future Boost.RDB submission, I feel tempted to put everything except the names that are in the public (documented) interface in a nested `namespace detail`. Why not even put *everything* there and copy selected names in the public namespace by means of using-declarations.
private functions should never be in the same namespace as public classes, because ADL can pick them up.
Has it been already done ? And what about having three namespaces : a "public" one for the user, a "protected" one for those extending the lib, and a "private" one for undocumented internals?
In Christ, Steven Watanabe

For my future Boost.RDB submission, I feel tempted to put everything except the names that are in the public (documented) interface in a nested `namespace detail`.
Nod: ideally only public documented interfaces should be in the top level namespace.
Why not even put *everything* there and copy selected names in the public namespace by means of using-declarations.
Note that this can break ADL and/or user-specialisations of documented interfaces. Of course if you don't want those happenning... HTH, John.
Has it been already done ? And what about having three namespaces : a "public" one for the user, a "protected" one for those extending the lib, and a "private" one for undocumented internals?
Opinions and advise welcome...
J-L
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-------------------------------------------------------------------------------- No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.421 / Virus Database: 270.14.11/2430 - Release Date: 10/12/09 04:01:00
participants (3)
-
Jean-Louis Leroy
-
John Maddock
-
Steven Watanabe