Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54849 - trunk/libs/fusion/test/sequence
From: joel_at_[hidden]
Date: 2009-07-09 20:49:52


Author: djowel
Date: 2009-07-09 20:49:51 EDT (Thu, 09 Jul 2009)
New Revision: 54849
URL: http://svn.boost.org/trac/boost/changeset/54849

Log:
Fix #1601
Text files modified:
   trunk/libs/fusion/test/sequence/boost_tuple.cpp | 11 +++++++++++
   1 files changed, 11 insertions(+), 0 deletions(-)

Modified: trunk/libs/fusion/test/sequence/boost_tuple.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/boost_tuple.cpp (original)
+++ trunk/libs/fusion/test/sequence/boost_tuple.cpp 2009-07-09 20:49:51 EDT (Thu, 09 Jul 2009)
@@ -12,6 +12,7 @@
 #include <boost/fusion/sequence/intrinsic/front.hpp>
 #include <boost/fusion/sequence/intrinsic/back.hpp>
 #include <boost/fusion/sequence/io/out.hpp>
+#include <boost/fusion/iterator/distance.hpp>
 #include <boost/fusion/container/vector/vector.hpp>
 #include <boost/fusion/container/list/list.hpp>
 #include <boost/fusion/container/generation/make_vector.hpp>
@@ -84,6 +85,16 @@
         fusion::list<int, std::string> l(tuples::make_tuple(123, "Hola!!!"));
         l = tuples::make_tuple(123, "Hola!!!");
     }
+
+ {
+ // test from Ticket #1601, submitted by Shunsuke Sogame
+ // expanded by Stjepan Rajko
+ boost::tuple<int, char> t(3, 'a');
+
+ BOOST_TEST(0u == fusion::distance(fusion::begin(t), fusion::begin(t)));
+ BOOST_TEST(1u == fusion::distance(fusion::begin(t), fusion::next(fusion::begin(t))));
+ BOOST_TEST(2u == fusion::distance(fusion::begin(t), fusion::end(t)));
+ }
 
     return boost::report_errors();
 }


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