Boost: what is a convenience header?

What is the difference between a header and a convenience header in boost?

+5
source share
2 answers

A convenience header is usually (and not just in Boost) a header that includes a number of other headers (which contain the actual code) that are usually used together, although there are no hard dependencies between them (which is why they are "separated first").

+13
source

It includes many different but related headers.

For example, boost / smart_ptr.hpp includes general-purpose pointer containers and scope:

//
//  smart_ptr.hpp
//
//  For convenience, this header includes the rest of the smart
//  pointer library headers.
//
//  Copyright (c) 2003 Peter Dimov  Distributed under the Boost
//  Software License, Version 1.0. (See accompanying file
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
//  http://www.boost.org/libs/smart_ptr/smart_ptr.htm
//

#include <boost/config.hpp>

#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>

#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES)
# include <boost/weak_ptr.hpp>
# include <boost/intrusive_ptr.hpp>
# include <boost/enable_shared_from_this.hpp>
#endif
+7
source

All Articles