mirror of
https://github.com/boostorg/container.git
synced 2025-08-01 05:24:31 +02:00
Use SFINAE to avoid errors in C++03 mode and std::pair
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
#include <boost/container/detail/config_begin.hpp>
|
#include <boost/container/detail/config_begin.hpp>
|
||||||
#include <boost/container/detail/workaround.hpp>
|
#include <boost/container/detail/workaround.hpp>
|
||||||
#include <boost/container/detail/mpl.hpp>
|
#include <boost/container/detail/mpl.hpp>
|
||||||
|
#include <boost/container/detail/is_pair.hpp>
|
||||||
#include <boost/move/utility_core.hpp>
|
#include <boost/move/utility_core.hpp>
|
||||||
#include <boost/container/detail/type_traits.hpp>
|
#include <boost/container/detail/type_traits.hpp>
|
||||||
#include <boost/move/detail/launder.hpp> //adl_move_swap
|
#include <boost/move/detail/launder.hpp> //adl_move_swap
|
||||||
@@ -101,7 +102,8 @@ enum EmplaceOptions{
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<class Container>
|
template<class Container>
|
||||||
bool test_expected_container(const Container &ec, const EmplaceInt *Expected, unsigned int only_first_n, unsigned int cont_offset = 0)
|
typename boost::container::dtl::enable_if_c< !boost::container::dtl::is_pair<typename Container::value_type>::value, bool>::type
|
||||||
|
test_expected_container(const Container &ec, const EmplaceInt *Expected, unsigned int only_first_n, unsigned int cont_offset = 0)
|
||||||
{
|
{
|
||||||
typedef typename Container::const_iterator const_iterator;
|
typedef typename Container::const_iterator const_iterator;
|
||||||
const_iterator itb(ec.begin()), ite(ec.end());
|
const_iterator itb(ec.begin()), ite(ec.end());
|
||||||
@@ -125,7 +127,8 @@ bool test_expected_container(const Container &ec, const EmplaceInt *Expected, un
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class Container>
|
template<class Container>
|
||||||
bool test_expected_container(const Container &ec, const std::pair<EmplaceInt, EmplaceInt> *Expected, unsigned int only_first_n)
|
typename boost::container::dtl::enable_if_c<boost::container::dtl::is_pair<typename Container::value_type>::value, bool>::type
|
||||||
|
test_expected_container(const Container &ec, const std::pair<EmplaceInt, EmplaceInt> *Expected, unsigned int only_first_n)
|
||||||
{
|
{
|
||||||
typedef typename Container::const_iterator const_iterator;
|
typedef typename Container::const_iterator const_iterator;
|
||||||
const_iterator itb(ec.begin()), ite(ec.end());
|
const_iterator itb(ec.begin()), ite(ec.end());
|
||||||
|
Reference in New Issue
Block a user