Update of /cvsroot/boost/boost/boost/fusion/sequence/adapted/variant
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31734

Modified Files:
        variant_iterator.hpp 
Log Message:
minor tweaks

Index: variant_iterator.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/fusion/sequence/adapted/variant/variant_iterator.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- variant_iterator.hpp        12 Nov 2006 23:07:18 -0000      1.1
+++ variant_iterator.hpp        13 Nov 2006 01:16:28 -0000      1.2
@@ -77,14 +77,20 @@
                 typename add_const<typename mpl::deref<typename 
Iterator::iterator>::type>,
                 typename mpl::deref<typename Iterator::iterator>
                 >::type 
+            value_type;
+
+            typedef typename 
+                add_reference<value_type>::type
             type;
 
             static type
             call(Iterator const & it)
             {
                 typedef typename mpl::deref<typename Iterator::iterator>::type 
type;
-                type* result = get<type>(&it.var_);
-                return result ? *result : type();
+                if (type* result = get<type>(&it.var_))
+                    return *result;
+                it.var_ = type(); // prime the variant
+                return *boost::get<type>(&it.var_); // no-throw!
             }
         };
     };


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to