Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53273 - trunk/libs/multi_index/test
From: joaquin_at_[hidden]
Date: 2009-05-26 02:34:34


Author: joaquin
Date: 2009-05-26 02:34:33 EDT (Tue, 26 May 2009)
New Revision: 53273
URL: http://svn.boost.org/trac/boost/changeset/53273

Log:
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).
Text files modified:
   trunk/libs/multi_index/test/pair_of_ints.hpp | 21 ++++++++++++++-------
   1 files changed, 14 insertions(+), 7 deletions(-)

Modified: trunk/libs/multi_index/test/pair_of_ints.hpp
==============================================================================
--- trunk/libs/multi_index/test/pair_of_ints.hpp (original)
+++ trunk/libs/multi_index/test/pair_of_ints.hpp 2009-05-26 02:34:33 EDT (Tue, 26 May 2009)
@@ -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 @@
 #if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
 namespace boost{
 namespace serialization{
-#else
-namespace std{
 #endif
 
 template<class Archive>
@@ -64,8 +73,6 @@
 #if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
 } /* namespace serialization */
 } /* namespace boost*/
-#else
-} /* namespace std */
 #endif
 
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk