提升:什么是"便利标题"?

jld*_*ont 5 c++ boost

boost中"header"和"easy header"有什么区别?

Pav*_*aev 14

便捷标题通常(不仅仅是在Boost中)包含许多其他标题(包含实际代码)的标题,它们通常一起使用,即使它们之间没有硬依赖关系(这就是为什么它们是分开的)第一名).


Kit*_*YMG 7

它包含许多不同但相关的标题

例如,boost/smart_ptr.hpp包括共享和范围指针容器:

//
//  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
Run Code Online (Sandbox Code Playgroud)