Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-05-27 16:18:20


At 11:44 AM 5/27/2003, Peter Dimov wrote:
>Chuck Messenger wrote:
>> For convenience, logical continuity, and consistency with other Boost
>> libraries, you should be able to include all the smart_ptr pieces with
>>
>> #include <boost/smart_ptr.hpp>
>>
>> Currently, only 4 are included:
>>
>> #include <boost/scoped_ptr.hpp>
>> #include <boost/scoped_array.hpp>
>> #include <boost/shared_ptr.hpp>
>> #include <boost/shared_array.hpp>
>>
>> Missing are:
>>
>> #include <boost/weak_ptr.hpp>
>> #include <boost/intrusive_ptr.hpp>
>> #include <boost/enable_shared_from_this.hpp>
>>
>> If the idea was to leave out rarely-used, specialized pieces, in order
>> to cut down on extraneous compile time, then I'd suggest that
>> weak_ptr.hpp needs to be included in smart_ptr.hpp -- it seems to me
>> to be one of the essential, common components of the smart_ptr system.
>
>smart_ptr.hpp is only provided for backward compatibility. In an earlier
>version of Boost it contained the four scoped_* and shared_* class
>templates. New code should include the appropriate header files directly.

Some people (me included!) aren't particularly fond of such fine
granularity for robust code. It increases errors. True, the errors are
trivial to fix, but that still adds an additional edit-and-rebuild cycle.
Providing both the fine-grained and the coarse-grained headers lets the
users decide which they prefer.

I've heard reports from compiler support people that missing #includes
generate more "your compiler is broken" support calls that you might think.

--Beman


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