diff --git a/include/boost/container/container_fwd.hpp b/include/boost/container/container_fwd.hpp index db7a67f..20ac778 100644 --- a/include/boost/container/container_fwd.hpp +++ b/include/boost/container/container_fwd.hpp @@ -41,65 +41,24 @@ //! //! And finally it defines the following types -////////////////////////////////////////////////////////////////////////////// -// Standard predeclarations -////////////////////////////////////////////////////////////////////////////// - #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED +//Std forward declarations +#ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP + #include +#endif + namespace boost{ namespace intrusive{ //Create namespace to avoid compilation errors }} namespace boost{ namespace container{ namespace container_detail{ - -namespace bi = boost::intrusive; - + namespace bi = boost::intrusive; }}} #include -# if defined(__clang__) && defined(_LIBCPP_VERSION) - #define BOOST_CONTAINER_CLANG_INLINE_STD_NS - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wc++11-extensions" - - #define BOOST_CONTAINER_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD - #define BOOST_CONTAINER_STD_NS_END _LIBCPP_END_NAMESPACE_STD - -#endif - -#if !defined(BOOST_CONTAINER_STD_NS_BEG) - - #define BOOST_CONTAINER_STD_NS_BEG namespace std{ - #define BOOST_CONTAINER_STD_NS_END } - -#endif - -BOOST_CONTAINER_STD_NS_BEG - -template -class allocator; - -template -struct less; - -template -struct pair; - -template -struct char_traits; - -BOOST_CONTAINER_STD_NS_END - -#ifdef BOOST_CONTAINER_CLANG_INLINE_STD_NS - -#pragma GCC diagnostic pop -#undef BOOST_CONTAINER_CLANG_INLINE_STD_NS - -#endif //BOOST_CONTAINER_CLANG_INLINE_STD_NS - #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED ////////////////////////////////////////////////////////////////////////////// diff --git a/include/boost/container/detail/node_alloc_holder.hpp b/include/boost/container/detail/node_alloc_holder.hpp index 68cc42b..250c559 100644 --- a/include/boost/container/detail/node_alloc_holder.hpp +++ b/include/boost/container/detail/node_alloc_holder.hpp @@ -32,9 +32,8 @@ #include #include #include -#include -#include #include +#include #ifndef BOOST_CONTAINER_PERFECT_FORWARDING #include diff --git a/include/boost/container/detail/preprocessor.hpp b/include/boost/container/detail/preprocessor.hpp index 9cae499..838eff2 100644 --- a/include/boost/container/detail/preprocessor.hpp +++ b/include/boost/container/detail/preprocessor.hpp @@ -32,10 +32,7 @@ #include #include #include -#include -#include #include -#include #include #include #include diff --git a/include/boost/container/detail/std_fwd.hpp b/include/boost/container/detail/std_fwd.hpp new file mode 100644 index 0000000..a2edecc --- /dev/null +++ b/include/boost/container/detail/std_fwd.hpp @@ -0,0 +1,59 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2014-2014. 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_STD_FWD_HPP +#define BOOST_CONTAINER_DETAIL_STD_FWD_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +////////////////////////////////////////////////////////////////////////////// +// Standard predeclarations +////////////////////////////////////////////////////////////////////////////// + +#if defined(__clang__) && defined(_LIBCPP_VERSION) + #define BOOST_CONTAINER_CLANG_INLINE_STD_NS + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wc++11-extensions" + #define BOOST_CONTAINER_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD + #define BOOST_CONTAINER_STD_NS_END _LIBCPP_END_NAMESPACE_STD +#else + #define BOOST_CONTAINER_STD_NS_BEG namespace std{ + #define BOOST_CONTAINER_STD_NS_END } +#endif + +BOOST_CONTAINER_STD_NS_BEG + +template +class allocator; + +template +struct less; + +template +struct pair; + +template +struct char_traits; + +struct input_iterator_tag; +struct forward_iterator_tag; +struct bidirectional_iterator_tag; +struct random_access_iterator_tag; + +BOOST_CONTAINER_STD_NS_END + +#ifdef BOOST_CONTAINER_CLANG_INLINE_STD_NS + #pragma GCC diagnostic pop + #undef BOOST_CONTAINER_CLANG_INLINE_STD_NS +#endif //BOOST_CONTAINER_CLANG_INLINE_STD_NS + +#endif //#ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP diff --git a/include/boost/container/detail/type_traits.hpp b/include/boost/container/detail/type_traits.hpp index a461500..9ff3614 100644 --- a/include/boost/container/detail/type_traits.hpp +++ b/include/boost/container/detail/type_traits.hpp @@ -22,8 +22,6 @@ #include #include -#include - namespace boost { namespace container { namespace container_detail { @@ -101,6 +99,15 @@ struct remove_reference #else +} // namespace container_detail { +} //namespace container { + +template +class rv; + +namespace container { +namespace container_detail { + template struct remove_reference< ::boost::rv > { @@ -206,6 +213,21 @@ struct remove_ref_const typedef typename remove_const< typename remove_reference::type >::type type; }; +template +struct make_unsigned +{ + typedef T type; +}; + +template <> struct make_unsigned {}; +template <> struct make_unsigned {typedef unsigned char type;}; +template <> struct make_unsigned {typedef unsigned short type;}; +template <> struct make_unsigned {typedef unsigned int type;}; +template <> struct make_unsigned {typedef unsigned long type;}; +#ifdef BOOST_HAS_LONG_LONG +template <> struct make_unsigned {typedef unsigned long long type;}; +#endif + } // namespace container_detail } //namespace container { } //namespace boost { diff --git a/include/boost/container/scoped_allocator.hpp b/include/boost/container/scoped_allocator.hpp index 9b3c6d9..0a29871 100644 --- a/include/boost/container/scoped_allocator.hpp +++ b/include/boost/container/scoped_allocator.hpp @@ -292,7 +292,7 @@ namespace container_detail { #else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - //Without variadic templates, we need to use de preprocessor to generate + //Without variadic templates, we need to use the preprocessor to generate //some specializations. #define BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS \ diff --git a/include/boost/container/slist.hpp b/include/boost/container/slist.hpp index d4ecde9..b6b4c38 100644 --- a/include/boost/container/slist.hpp +++ b/include/boost/container/slist.hpp @@ -31,6 +31,7 @@ #include #include #include +#include #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) diff --git a/proj/vc7ide/container.vcproj b/proj/vc7ide/container.vcproj index 7d606ea..291c603 100644 --- a/proj/vc7ide/container.vcproj +++ b/proj/vc7ide/container.vcproj @@ -257,6 +257,9 @@ + + diff --git a/test/scoped_allocator_adaptor_test.cpp b/test/scoped_allocator_adaptor_test.cpp index 425e295..dadeba6 100644 --- a/test/scoped_allocator_adaptor_test.cpp +++ b/test/scoped_allocator_adaptor_test.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include using namespace boost::container; diff --git a/test/vector_test.cpp b/test/vector_test.cpp index ad331b7..0ec3eb1 100644 --- a/test/vector_test.cpp +++ b/test/vector_test.cpp @@ -7,10 +7,8 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include -#include + #include -#include #include #include @@ -160,7 +158,7 @@ int main() positions[i] = 0u; } for(std::size_t i = 0, max = vector_int2.size(); i != max; ++i){ - vector_int2[i] = i; + vector_int2[i] = (int)i; } vector_int.insert(vector_int.begin(), 999); @@ -254,4 +252,3 @@ int main() return 0; } -#include