Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75589 - in trunk/boost/property_tree: . detail
From: sebastian.redl_at_[hidden]
Date: 2011-11-21 07:11:07


Author: cornedbee
Date: 2011-11-21 07:11:06 EST (Mon, 21 Nov 2011)
New Revision: 75589
URL: http://svn.boost.org/trac/boost/changeset/75589

Log:
Make ptree_bad_data::data() and ptree_bad_path::path() const. See bug #5757.
Text files modified:
   trunk/boost/property_tree/detail/exception_implementation.hpp | 4 ++--
   trunk/boost/property_tree/exceptions.hpp | 10 ++++++----
   2 files changed, 8 insertions(+), 6 deletions(-)

Modified: trunk/boost/property_tree/detail/exception_implementation.hpp
==============================================================================
--- trunk/boost/property_tree/detail/exception_implementation.hpp (original)
+++ trunk/boost/property_tree/detail/exception_implementation.hpp 2011-11-21 07:11:06 EST (Mon, 21 Nov 2011)
@@ -53,7 +53,7 @@
     }
 
     template<class D> inline
- D ptree_bad_data::data()
+ D ptree_bad_data::data() const
     {
         return boost::any_cast<D>(m_data);
     }
@@ -73,7 +73,7 @@
     }
 
     template<class P> inline
- P ptree_bad_path::path()
+ P ptree_bad_path::path() const
     {
         return boost::any_cast<P>(m_path);
     }

Modified: trunk/boost/property_tree/exceptions.hpp
==============================================================================
--- trunk/boost/property_tree/exceptions.hpp (original)
+++ trunk/boost/property_tree/exceptions.hpp 2011-11-21 07:11:06 EST (Mon, 21 Nov 2011)
@@ -51,8 +51,9 @@
         ~ptree_bad_data() throw();
 
         /// Retrieve the data associated with this error. This is the source
- /// value that failed to be translated.
- template<class T> T data();
+ /// value that failed to be translated. You need to explicitly
+ /// specify its type.
+ template<class T> T data() const;
     private:
         boost::any m_data;
     };
@@ -71,8 +72,9 @@
 
         ~ptree_bad_path() throw();
 
- /// Retrieve the invalid path.
- template<class T> T path();
+ /// Retrieve the invalid path. You need to explicitly specify the
+ /// type of path.
+ template<class T> T path() const;
     private:
         boost::any m_path;
     };


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