Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost: what is a "convenience header"?

Tags:

c++

boost

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

like image 378
jldupont Avatar asked Nov 13 '09 20:11

jldupont


2 Answers

A convenience header is typically (not just in Boost) a header which includes a number of other headers (that contain actual code) which are commonly used together, even though there are no hard dependencies between them (which is why they're separate in the first place).

like image 77
Pavel Minaev Avatar answered Sep 26 '22 15:09

Pavel Minaev


It includes a lot of different but related headers

For example boost/smart_ptr.hpp includes shared and scoped pointer containers:

//
//  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
like image 44
KitsuneYMG Avatar answered Sep 23 '22 15:09

KitsuneYMG