Refactor std namespace deduction for forward declarations

This commit is contained in:
Ion Gaztañaga
2015-09-14 22:33:20 +02:00
parent 9120f5011e
commit 09c75813a6
4 changed files with 47 additions and 19 deletions

View File

@@ -24,20 +24,7 @@
#include <cstddef>
#if defined(__clang__)
#define BOOST_MOVE_CLANG_INLINE_STD_NS
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc++11-extensions"
#endif
#ifdef _LIBCPP_VERSION
#define BOOST_MOVE_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD
#define BOOST_MOVE_STD_NS_END _LIBCPP_END_NAMESPACE_STD
#else
#define BOOST_MOVE_STD_NS_BEG namespace std{
#define BOOST_MOVE_STD_NS_END }
#endif
#include <boost/move/detail/std_ns_begin.hpp>
BOOST_MOVE_STD_NS_BEG
struct input_iterator_tag;
@@ -47,11 +34,7 @@ struct random_access_iterator_tag;
struct output_iterator_tag;
BOOST_MOVE_STD_NS_END
#ifdef BOOST_MOVE_CLANG_INLINE_STD_NS
#pragma GCC diagnostic pop
#undef BOOST_MOVE_CLANG_INLINE_STD_NS
#endif //BOOST_MOVE_CLANG_INLINE_STD_NS
#include <boost/move/detail/std_ns_end.hpp>
namespace boost{ namespace movelib{

View File

@@ -0,0 +1,30 @@
#//////////////////////////////////////////////////////////////////////////////
#//
#// (C) Copyright Ion Gaztanaga 2015-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/move for documentation.
#//
#//////////////////////////////////////////////////////////////////////////////
#
#if defined(_LIBCPP_VERSION)
#if defined(__clang__)
#define BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc++11-extensions"
#endif
#define BOOST_MOVE_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD
#define BOOST_MOVE_STD_NS_END _LIBCPP_END_NAMESPACE_STD
#elif defined(BOOST_GNU_STDLIB) && defined(_GLIBCXX_BEGIN_NAMESPACE_VERSION) //GCC >= 4.6
#define BOOST_MOVE_STD_NS_BEG namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define BOOST_MOVE_STD_NS_END _GLIBCXX_END_NAMESPACE_VERSION } // namespace
#elif defined(BOOST_GNU_STDLIB) && defined(_GLIBCXX_BEGIN_NAMESPACE) //GCC >= 4.2
#define BOOST_MOVE_STD_NS_BEG _GLIBCXX_BEGIN_NAMESPACE(std)
#define BOOST_MOVE_STD_NS_END _GLIBCXX_END_NAMESPACE
#else
#define BOOST_MOVE_STD_NS_BEG namespace std{
#define BOOST_MOVE_STD_NS_END }
#endif

View File

@@ -0,0 +1,14 @@
#//////////////////////////////////////////////////////////////////////////////
#//
#// (C) Copyright Ion Gaztanaga 2015-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/move for documentation.
#//
#//////////////////////////////////////////////////////////////////////////////
#ifdef BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH
#pragma GCC diagnostic pop
#undef BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH
#endif //BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH

View File

@@ -249,6 +249,7 @@ Global
..\..\..\..\boost\move\move.hpp = ..\..\..\..\boost\move\move.hpp
..\..\doc\move.qbk = ..\..\doc\move.qbk
..\..\..\..\boost\move\detail\move_helpers.hpp = ..\..\..\..\boost\move\detail\move_helpers.hpp
..\..\..\..\boost\move\detail\std_ns_begin.hpp = ..\..\..\..\boost\move\detail\std_ns_begin.hpp
..\..\..\..\boost\move\traits.hpp = ..\..\..\..\boost\move\traits.hpp
..\..\..\..\boost\move\detail\type_traits.hpp = ..\..\..\..\boost\move\detail\type_traits.hpp
..\..\..\..\boost\move\unique_ptr.hpp = ..\..\..\..\boost\move\unique_ptr.hpp