Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2006-10-18 07:43:23


The following patch clears the failures with the Borland compiler for the
program options lib. Is this OK to commit or was there a specific reason
why those functions were declared outside the class body? It shouldn't make
any difference either which way, but you never know :-)

While we're at it: the test program convert_test.cpp appears not to build
with any compiler, and isn't currently being built by our test matrix?

Regards, John.

Index: boost/program_options/variables_map.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/program_options/variables_map.hpp,v
retrieving revision 1.5.6.5
diff -u -r1.5.6.5 variables_map.hpp
--- boost/program_options/variables_map.hpp 6 Jun 2006
14:30:28 -00001.5.6.5

+++ boost/program_options/variables_map.hpp 18 Oct 2006 11:39:29 -0000
@@ -57,10 +57,15 @@

         /** If stored value if of type T, returns that value. Otherwise,
             throws boost::bad_any_cast exception. */
- template<class T> const T& as() const;
-
- /** @overload */
- template<class T> T& as();
+ template<class T>
+ const T& as() const {
+ return boost::any_cast<const T&>(v);
+ }
+ // overload:
+ template<class T>
+ T& as() {
+ return boost::any_cast<T&>(v);
+ }

         /// Returns true if no value is stored.
         bool empty() const;
@@ -185,18 +190,6 @@
         return v;
     }

-
- template<class T>
- const T&
- variable_value::as() const {
- return boost::any_cast<const T&>(v);
- }
-
- template<class T>
- T&
- variable_value::as() {
- return boost::any_cast<T&>(v);
- }
 }}

 #endif


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk