From 7398ab9baee399ca79ac1caadeabf2a7248e50cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 19 Oct 2024 23:09:28 +0200 Subject: [PATCH] Fixes #292 ("Forward declarations of std types cause compilation errors on some platforms") --- doc/move.qbk | 9 +++++++++ include/boost/move/detail/std_ns_begin.hpp | 16 ++++++++-------- include/boost/move/detail/std_ns_end.hpp | 3 +++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/doc/move.qbk b/doc/move.qbk index aba2aaf..a04f918 100644 --- a/doc/move.qbk +++ b/doc/move.qbk @@ -802,6 +802,15 @@ Special thanks to: [section:release_notes Release Notes] +[section:release_notes_boost_1_87 Boost 1.87 Release] + +* Fixed bugs: + * [@https://github.com/boostorg/move/issues/292 Git Issue #292: ['"Forward declarations of std types cause compilation errors on some platforms"]]. + +[endsect] + +Forward declarations of std types cause compilation errors on some platforms #292 + [section:release_notes_boost_1_85 Boost 1.85 Release] * Fixed bugs: diff --git a/include/boost/move/detail/std_ns_begin.hpp b/include/boost/move/detail/std_ns_begin.hpp index 1d28117..de13cde 100644 --- a/include/boost/move/detail/std_ns_begin.hpp +++ b/include/boost/move/detail/std_ns_begin.hpp @@ -23,12 +23,12 @@ #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 - #if defined(_MSC_VER) && (_MSC_VER >= 1915) - #pragma warning (push) - #pragma warning (disable : 4643) // Forward declaring 'X' in namespace std is not permitted by the C++ Standard - #endif - - #define BOOST_MOVE_STD_NS_BEG namespace std{ - #define BOOST_MOVE_STD_NS_END } +#elif defined(BOOST_DINKUMWARE_STDLIB) + #define BOOST_MOVE_STD_NS_BEG _STD_BEGIN + #define BOOST_MOVE_STD_NS_END _STD_END +#endif + +#if defined(_MSC_VER) && (_MSC_VER >= 1915) + #pragma warning (push) + #pragma warning (disable : 4643) // Forward declaring 'X' in namespace std is not permitted by the C++ Standard #endif diff --git a/include/boost/move/detail/std_ns_end.hpp b/include/boost/move/detail/std_ns_end.hpp index 61af2d7..abc40ed 100644 --- a/include/boost/move/detail/std_ns_end.hpp +++ b/include/boost/move/detail/std_ns_end.hpp @@ -14,3 +14,6 @@ #elif defined(_MSC_VER) && (_MSC_VER >= 1915) #pragma warning (pop) #endif //BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH + +#undef BOOST_MOVE_STD_NS_BEG +#undef BOOST_MOVE_STD_NS_END