diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index e4843f5..09a2c25 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -52,6 +52,12 @@ #define BOOST_CONTAINER_STD_PAIR_IS_MOVABLE #endif +//for C++03 compilers, were type-puning is the only option for std::pair +//disable strict aliasing to reduce problems. +#if defined(BOOST_GCC) && (BOOST_GCC >= 100000) && !defined(BOOST_CONTAINER_STD_PAIR_IS_MOVABLE) +#pragma GCC push_options +#pragma GCC optimize("no-strict-aliasing") +#endif namespace boost { namespace container { @@ -3014,6 +3020,10 @@ class flat_multimap { x.swap(y); } }; +#if defined(BOOST_GCC) && (BOOST_GCC >= 100000) && !defined(BOOST_CONTAINER_STD_PAIR_IS_MOVABLE) +#pragma GCC pop_options +#endif + #ifndef BOOST_CONTAINER_NO_CXX17_CTAD template