Boost logo

Boost :

From: Ed Brey (brey_at_[hidden])
Date: 2002-04-22 20:43:07

"Daryle Walker" <darylew_at_[hidden]> wrote in message
> A directory with lots of entries is harder to search through. Also we have
> a lot of names in the "boost" namespace. There have been suggestions to use
> sub-namespaces to prevent name collisions. These sub-namespaces can be used
> to separate the libraries to their various domains. The directory
> structures should match the name hierarchy to prevent confusion on how to
> find an item.

I agree about the directories matching the namespaces. For qualification of "a lot" of names, see below.

> The initial idea for the I/O library was introducing the stuff I wrote in
> the more_io package in a piecemeal fashion. Others are free to use it. The
> lexical_cast functionality could be moved if the maintainer wishes. The
> format package is an example of a new library that someone else did that
> could also go there.

I agree in the general sense of a standard library creating a hierarchy for its names. When I use the standard libraries of Java, Python, and C# (CLR), I appreciate the hierarchies and don't mind the qualification. OTOH, one could argue that C++'s breakdown - by include file only - is fine. However, it does cause the using directive to be less usable. When granularity is small enough, the frequency of clashes (present or future) caused by a using directive can become small enough to justify its use.

For boost, one issue is whether there is enough content to make a namespace worthwhile. Another problem is that boost is not standard. For example, suppose that format was in boost::io. A translation unit would either have to always use boost::io::format, or do something like "using boost::io" and then io::format. Now suppose that std adopts a hierarchy, and we have std::io::format. New code in the translation unit might like to use the (incompatible with boost) std::io::format. Moving forward, it would be nice to reserve code such as "io::format" to point to standard libraries.

Based on the relatively small size of boost and its temporality, one approach is to dump just about everything in the root boost namespace, with the expectation that it will be used in a qualified fashion (or via a using declaration) until it is adopted into the standard. By that time, all the pieces will be visible on the table and a hierarchy can be established at that time.

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