Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-08-18 11:53:40

Rob Stewart <stewart_at_[hidden]> writes:

> From: David Abrahams <dave_at_[hidden]>
>> Rob Stewart <stewart_at_[hidden]> writes:
>> What libraries are doing that? The authors might need a dope-slap. I
>> hope it's not one of mine! ;-)
> This isn't exhaustive, but here are a few examples that I found
> (I tried to skip related matches):
> detail/atomic_count.hpp:83
> detail/binary_search.hpp:34
> detail/call_traits.hpp:32
> detail/compressed_pair.hpp:39
> detail/dynamic_bitset.hpp:26
> detail/lwm_nop.hpp:23
> detail/named_template_params.hpp:21
> detail/quick_allocator.hpp:33
> detail/shared_count.hpp:40
> graph/adjacency_list.hpp:230
> iterator/counting_iterator.hpp:24
> pool/pool.hpp:71
> test/execution_monitor.hpp:51
> thread/condition.hpp:31
> type_traits/add_pointer.hpp:19
> utility/enable_if.hpp:78

I can't speak for all of these, but some of them are libraries that
don't have their own namespace (e.g. enable_if). As long as enable_if
is directly in namespace boost, it makes sense that its detail is in
boost::detail. Whether or not enable_if should be in a subnamespace
is a different fight. The same applies to
iterator/counting_iterator.hpp, for example.

The ones in detail/ are mostly components that were deemed to be of
general utility within Boost but whose authors were not ready to give
them a "public face" (i.e. review, documentation). They do not
officially "belong" to any specific library and are often used across
several libraries. Having them in boost::detail makes sense.

> The following are examples in which another namespace is created
> inside boost::detail rather than a detail namespace within the
> library namespace. This keeps the names separate, but still
> seems inverted.

> detail/allocator_utilities.hpp:23
> function/function_base.hpp:106
> multi_array/algorithm.hpp:46
> variant/get.hpp:59

Yep, that's a little weird. I can say from experience that in a
subnamespace of boost it can be awkward to have both
boost::subnamespace::detail and boost::detail in scope, so it is
sometime better to use another name (like aux:: a la MPL).

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at