handcrafted pair_of_ints to guarantee that first and second belong to pair_of_ints proper and not to some implementation-specific base class, which happens with std::pair in MSVC 10 thus precluding the use of boost::multi_index::member as per 14.3.2/5 (no conversions applied to pointer to member functions template arguments).

[SVN r53273]
This commit is contained in:
Joaquín M López Muñoz 2009-05-26 06:34:33 +00:00
parent 1eebcfcf5f
commit a5210bff85

View File

@ -1,6 +1,6 @@
/* Used in Boost.MultiIndex tests.
*
* Copyright 2003-2008 Joaquin M Lopez Munoz.
* Copyright 2003-2009 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@ -13,9 +13,20 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/serialization/nvp.hpp>
#include <utility>
typedef std::pair<int,int> pair_of_ints;
struct pair_of_ints
{
pair_of_ints(int first_=0,int second_=0):first(first_),second(second_){}
bool operator==(const pair_of_ints& x)const
{
return first==x.first&&second==x.second;
}
bool operator!=(const pair_of_ints& x)const{return !(*this==x);}
int first,second;
};
inline void increment_first(pair_of_ints& p)
{
@ -50,8 +61,6 @@ inline void decrement_int(int& x)
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
namespace boost{
namespace serialization{
#else
namespace std{
#endif
template<class Archive>
@ -64,8 +73,6 @@ void serialize(Archive& ar,pair_of_ints& p,const unsigned int)
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
} /* namespace serialization */
} /* namespace boost*/
#else
} /* namespace std */
#endif
#endif