From 09b653c40b947097262bd333a8a1ac6905b07411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Fri, 9 Jan 2015 21:49:52 +0100 Subject: [PATCH] Define insert_iterator specialization in inline namespace std in libc++. --- include/boost/container/slist.hpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/include/boost/container/slist.hpp b/include/boost/container/slist.hpp index d11c560..9805a15 100644 --- a/include/boost/container/slist.hpp +++ b/include/boost/container/slist.hpp @@ -1638,12 +1638,18 @@ namespace container { #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED -//Ummm, I don't like to define things in namespace std, but -//there is no other way -namespace std { +#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 -template -class insert_iterator; +BOOST_CONTAINER_STD_NS_BEG template class insert_iterator > @@ -1676,7 +1682,12 @@ class insert_iterator > insert_iterator& operator++(int){ return *this; } }; -} //namespace std; +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