Disable strict aliasing for C++03 implementations as type-punning is used to make value_type movable.

This commit is contained in:
Ion Gaztañaga
2024-05-30 23:07:57 +02:00
parent f46ee4391f
commit 0219333fa1

View File

@@ -52,6 +52,12 @@
#define BOOST_CONTAINER_STD_PAIR_IS_MOVABLE #define BOOST_CONTAINER_STD_PAIR_IS_MOVABLE
#endif #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 boost {
namespace container { namespace container {
@@ -3014,6 +3020,10 @@ class flat_multimap
{ x.swap(y); } { 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 #ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator> template <typename InputIterator>