Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2007-12-04 09:50:07


on Mon Dec 03 2007, Andrey Semashev <andysem-AT-mail.ru> wrote:

> Joel de Guzman wrote:
>> Anthony Williams wrote:
>>> Joel de Guzman <joel_at_[hidden]> writes:
>>>
>>>> * Non-core libraries may place a single consolidated convenience
>>>> header in boost/, forwarding to files of the form
>>>> boost/<libraryname>/<header>.hpp. Regardless, their documented
>>>> public components are not in boost/ or namespace boost::
>>> What about boost.thread? Though the "general use" header is boost/thread.hpp,
>>> and the other headers are in boost/thread/xyz.hpp, the public interface is and
>>> always has been in namespace boost::, and changing this now would be a
>>> breaking change.
>>
>> Seems that if thread is a non-core library then it indeed breaks the
>> "standard practice". I don't think a breaking change is a good idea
>> though. I'd like to hear other people's thoughts on this.
>
> Maybe the library should reside in its own sub-namespace and then this
> namespace should be imported into boost:: with using directive. This
> import would be optional, depending on some macro, and would be declared
> deprecated.

More simply, boost/thread.hpp could do

     #include "boost/thread/whatever.hpp"
     #include "boost/thread/whateverelse.hpp"
     namespace boost
     {
         using namespace threads;
     }

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk