Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59734 - trunk/boost/property_tree/detail
From: sebastian.redl_at_[hidden]
Date: 2010-02-17 12:40:15


Author: cornedbee
Date: 2010-02-17 12:40:14 EST (Wed, 17 Feb 2010)
New Revision: 59734
URL: http://svn.boost.org/trac/boost/changeset/59734

Log:
Work around a bug in the VC++10 standard library. Hopefully fixes bug 3594; regression tests will tell. This may need to be updated if subsequent releases have the same bug.
Text files modified:
   trunk/boost/property_tree/detail/ptree_implementation.hpp | 28 ++++++++++++++++++++++++++++
   1 files changed, 28 insertions(+), 0 deletions(-)

Modified: trunk/boost/property_tree/detail/ptree_implementation.hpp
==============================================================================
--- trunk/boost/property_tree/detail/ptree_implementation.hpp (original)
+++ trunk/boost/property_tree/detail/ptree_implementation.hpp 2010-02-17 12:40:14 EST (Wed, 17 Feb 2010)
@@ -15,6 +15,13 @@
 #include <boost/iterator/reverse_iterator.hpp>
 #include <memory>
 
+#if defined(BOOST_MSVC) && \
+ (_MSC_FULL_VER == 160020506 || \
+ _MSC_FULL_VER == 160021003 || \
+ _MSC_FULL_VER == 160030128)
+#define BOOST_PROPERTY_TREE_PAIR_BUG
+#endif
+
 namespace boost { namespace property_tree
 {
     template <class K, class D, class C>
@@ -22,6 +29,22 @@
     {
         struct by_name {};
         // The actual child container.
+#if defined(BOOST_PROPERTY_TREE_PAIR_BUG)
+ // MSVC 10 pre-release versions have moved std::pair's members to a base
+ // class. Unfortunately this does break the interface.
+ BOOST_STATIC_CONSTANT(unsigned,
+ first_offset = offsetof(value_type, first));
+ typedef multi_index_container<value_type,
+ multi_index::indexed_by<
+ multi_index::sequenced<>,
+ multi_index::ordered_non_unique<multi_index::tag<by_name>,
+ multi_index::member_offset<value_type, const key_type,
+ first_offset>,
+ key_compare
+ >
+ >
+ > base_container;
+#else
         typedef multi_index_container<value_type,
             multi_index::indexed_by<
                 multi_index::sequenced<>,
@@ -32,6 +55,7 @@
>
>
> base_container;
+#endif
         // The by-name lookup index.
         typedef typename base_container::template index<by_name>::type
             by_name_index;
@@ -872,4 +896,8 @@
 
 } }
 
+#if defined(BOOST_PROPERTY_TREE_PAIR_BUG)
+#undef BOOST_PROPERTY_TREE_PAIR_BUG
+#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