Boost logo

Boost-Commit :

From: nesotto_at_[hidden]
Date: 2007-11-07 11:54:11


Author: nesotto
Date: 2007-11-07 11:54:10 EST (Wed, 07 Nov 2007)
New Revision: 40892
URL: http://svn.boost.org/trac/boost/changeset/40892

Log:
changed constants to inline function to avoid ODR problems
Text files modified:
   trunk/boost/ptr_container/detail/serialize_ptr_map_adapter.hpp | 20 ++++++++++----------
   trunk/boost/ptr_container/detail/serialize_reversible_cont.hpp | 8 ++++----
   trunk/boost/ptr_container/detail/serialize_xml_names.hpp | 8 ++++----
   trunk/boost/ptr_container/serialize_ptr_array.hpp | 2 +-
   trunk/boost/ptr_container/serialize_ptr_vector.hpp | 2 +-
   5 files changed, 20 insertions(+), 20 deletions(-)

Modified: trunk/boost/ptr_container/detail/serialize_ptr_map_adapter.hpp
==============================================================================
--- trunk/boost/ptr_container/detail/serialize_ptr_map_adapter.hpp (original)
+++ trunk/boost/ptr_container/detail/serialize_ptr_map_adapter.hpp 2007-11-07 11:54:10 EST (Wed, 07 Nov 2007)
@@ -22,15 +22,15 @@
     typedef ptr_container_detail::ptr_map_adapter_base<T, VoidPtrMap, CloneAllocator> container;
     typedef BOOST_DEDUCED_TYPENAME container::const_iterator const_iterator;
 
- ar << boost::serialization::make_nvp( ptr_container_detail::count,
+ ar << boost::serialization::make_nvp( ptr_container_detail::count(),
                                           ptr_container_detail::serialize_as_const(c.size()) );
 
     const_iterator i = c.begin(), e = c.end();
     for(; i != e; ++i)
     {
- ar << boost::serialization::make_nvp( ptr_container_detail::first, i->first );
- ar << boost::serialization::make_nvp( ptr_container_detail::second,
- ptr_container_detail::serialize_as_const(i->second) );
+ ar << boost::serialization::make_nvp( ptr_container_detail::first(), i->first );
+ ar << boost::serialization::make_nvp( ptr_container_detail::second(),
+ ptr_container_detail::serialize_as_const(i->second) );
     }
 }
 
@@ -44,14 +44,14 @@
 
     c.clear();
     size_type n;
- ar >> boost::serialization::make_nvp( ptr_container_detail::count, n );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::count(), n );
 
     for(size_type i = 0u; i != n; ++i)
     {
         key_type key;
         T* value;
- ar >> boost::serialization::make_nvp( ptr_container_detail::first, key );
- ar >> boost::serialization::make_nvp( ptr_container_detail::second, value );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::first(), key );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::second(), value );
         std::pair<iterator, bool> p = c.insert(key, value);
         ar.reset_object_address(&p.first->first, &key);
     }
@@ -67,14 +67,14 @@
 
     c.clear();
     size_type n;
- ar >> boost::serialization::make_nvp( ptr_container_detail::count, n );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::count(), n );
 
     for(size_type i = 0u; i != n; ++i)
     {
         key_type key;
         T* value;
- ar >> boost::serialization::make_nvp( ptr_container_detail::first, key );
- ar >> boost::serialization::make_nvp( ptr_container_detail::second, value );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::first(), key );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::second(), value );
         iterator p = c.insert(key, value);
         ar.reset_object_address(&p->first, &key);
     }

Modified: trunk/boost/ptr_container/detail/serialize_reversible_cont.hpp
==============================================================================
--- trunk/boost/ptr_container/detail/serialize_reversible_cont.hpp (original)
+++ trunk/boost/ptr_container/detail/serialize_reversible_cont.hpp 2007-11-07 11:54:10 EST (Wed, 07 Nov 2007)
@@ -31,7 +31,7 @@
 
     const_iterator i = c.begin(), e = c.end();
     for(; i != e; ++i)
- ar << boost::serialization::make_nvp( ptr_container_detail::item,
+ ar << boost::serialization::make_nvp( ptr_container_detail::item(),
                 ptr_container_detail::serialize_as_const(static_cast<value_type>(*i.base())));
     }
 
@@ -55,7 +55,7 @@
         // so we need not call ar.reset_object_address(v, u)
         //
         value_type ptr;
- ar >> boost::serialization::make_nvp( ptr_container_detail::item, ptr );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::item(), ptr );
         c.insert(c.end(), ptr);
     }
 }
@@ -68,7 +68,7 @@
 template<class Archive, class Config, class CloneAllocator>
 void save(Archive& ar, const ptr_container_detail::reversible_ptr_container<Config, CloneAllocator>& c, unsigned int version)
 {
- ar << boost::serialization::make_nvp( ptr_container_detail::count,
+ ar << boost::serialization::make_nvp( ptr_container_detail::count(),
                                           ptr_container_detail::serialize_as_const(c.size()) );
     ptr_container_detail::save_helper(ar, c);
 }
@@ -80,7 +80,7 @@
     typedef BOOST_DEDUCED_TYPENAME container_type::size_type size_type;
     
     size_type n;
- ar >> boost::serialization::make_nvp( ptr_container_detail::count, n );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::count(), n );
     ptr_container_detail::load_helper(ar, c, n);
     
 }

Modified: trunk/boost/ptr_container/detail/serialize_xml_names.hpp
==============================================================================
--- trunk/boost/ptr_container/detail/serialize_xml_names.hpp (original)
+++ trunk/boost/ptr_container/detail/serialize_xml_names.hpp 2007-11-07 11:54:10 EST (Wed, 07 Nov 2007)
@@ -16,10 +16,10 @@
 {
     namespace ptr_container_detail
     {
- const char* count = "count";
- const char* item = "item";
- const char* first = "first";
- const char* second = "second";
+ inline const char* count() { return "count"; }
+ inline const char* item() { return "item"; }
+ inline const char* first() { return "first"; }
+ inline const char* second() { return "second"; }
     }
 }
 #endif

Modified: trunk/boost/ptr_container/serialize_ptr_array.hpp
==============================================================================
--- trunk/boost/ptr_container/serialize_ptr_array.hpp (original)
+++ trunk/boost/ptr_container/serialize_ptr_array.hpp 2007-11-07 11:54:10 EST (Wed, 07 Nov 2007)
@@ -30,7 +30,7 @@
     for(size_type i = 0u; i != N; ++i)
     {
         T* p;
- ar >> boost::serialization::make_nvp( ptr_container_detail::item, p );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::item(), p );
         c.replace(i, p);
     }
 }

Modified: trunk/boost/ptr_container/serialize_ptr_vector.hpp
==============================================================================
--- trunk/boost/ptr_container/serialize_ptr_vector.hpp (original)
+++ trunk/boost/ptr_container/serialize_ptr_vector.hpp 2007-11-07 11:54:10 EST (Wed, 07 Nov 2007)
@@ -22,7 +22,7 @@
     typedef BOOST_DEDUCED_TYPENAME container_type::size_type size_type;
     
     size_type n;
- ar >> boost::serialization::make_nvp( ptr_container_detail::count, n );
+ ar >> boost::serialization::make_nvp( ptr_container_detail::count(), n );
     c.reserve(n);
     
     ptr_container_detail::load_helper(ar, c, n);


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