New header, minimal_char_traits_header.hpp, to avoid including <string> to use char_traits when possible.

This commit is contained in:
Ion Gaztañaga
2015-01-04 02:30:57 +01:00
parent ddc89f32d9
commit 37578ccaa2
3 changed files with 36 additions and 3 deletions

View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2014-2015
//
// 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)
//
// See http://www.boost.org/libs/container for documentation.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_CONTAINER_DETAIL_MINIMAL_CHAR_TRAITS_HEADER_HPP
#define BOOST_CONTAINER_DETAIL_MINIMAL_CHAR_TRAITS_HEADER_HPP
#
#if defined(_MSC_VER)
# pragma once
#endif
#
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#
#//Try to avoid including <string>, as it's quite big
#if defined(_MSC_VER) && defined(BOOST_DINKUMWARE_STDLIB)
#include <iosfwd> //Dinkum libraries for MSVC define std::char_traits there
#elif defined(BOOST_GNU_STDLIB)
#include <bits/char_traits.h>
#else
#include <string> //Fallback
#endif
#endif //BOOST_CONTAINER_DETAIL_MINIMAL_CHAR_TRAITS_HEADER_HPP

View File

@@ -39,14 +39,12 @@
#include <boost/static_assert.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/container/detail/minimal_char_traits_header.hpp>
#include <boost/functional/hash.hpp>
#include <algorithm>
#include <functional> //bind2nd, etc.
#include <string>
#include <iosfwd>
#include <istream>
#include <ostream>

View File

@@ -242,6 +242,9 @@
<File
RelativePath="..\..\..\..\boost\container\detail\math_functions.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\container\detail\minimal_char_traits_header.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\container\detail\mpl.hpp">
</File>