Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74547 - in trunk/libs/fusion/test: . sequence
From: joel_at_[hidden]
Date: 2011-09-24 09:07:24


Author: djowel
Date: 2011-09-24 09:07:24 EDT (Sat, 24 Sep 2011)
New Revision: 74547
URL: http://svn.boost.org/trac/boost/changeset/74547

Log:
Added adapter for std::tuple (only for implementations using variadic templates)
Added:
   trunk/libs/fusion/test/sequence/std_tuple_iterator.cpp (contents, props changed)
Text files modified:
   trunk/libs/fusion/test/Jamfile | 1 +
   trunk/libs/fusion/test/sequence/iterator.hpp | 4 ++--
   trunk/libs/fusion/test/sequence/vector_iterator.cpp | 2 +-
   3 files changed, 4 insertions(+), 3 deletions(-)

Modified: trunk/libs/fusion/test/Jamfile
==============================================================================
--- trunk/libs/fusion/test/Jamfile (original)
+++ trunk/libs/fusion/test/Jamfile 2011-09-24 09:07:24 EDT (Sat, 24 Sep 2011)
@@ -135,6 +135,7 @@
     [ run sequence/define_assoc_struct.cpp : : : : ]
     [ run sequence/define_tpl_struct.cpp : : : : ]
     [ run sequence/define_assoc_tpl_struct.cpp : : : : ]
+ [ run sequence/std_tuple_iterator.cpp : : : : ]
 
     [ run functional/fused.cpp : : : : ]
     [ run functional/fused_function_object.cpp : : : : ]

Modified: trunk/libs/fusion/test/sequence/iterator.hpp
==============================================================================
--- trunk/libs/fusion/test/sequence/iterator.hpp (original)
+++ trunk/libs/fusion/test/sequence/iterator.hpp 2011-09-24 09:07:24 EDT (Sat, 24 Sep 2011)
@@ -1,7 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2011 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
 #include <string>
@@ -113,7 +113,7 @@
         BOOST_TEST(*next(next(next(i))) == s);
 
         next(next(next(next(i)))); // end
-
+
 #ifdef FUSION_TEST_FAIL
         next(next(next(next(next(i))))); // past the end: must not compile
 #endif

Added: trunk/libs/fusion/test/sequence/std_tuple_iterator.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/fusion/test/sequence/std_tuple_iterator.cpp 2011-09-24 09:07:24 EDT (Sat, 24 Sep 2011)
@@ -0,0 +1,35 @@
+/*=============================================================================
+ Copyright (c) 2001-2011 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#include <boost/config.hpp>
+
+// The std_tuple_iterator adaptor only supports implementations
+// using variadic templates
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+#include <boost/fusion/adapted/std_tuple.hpp>
+
+#define FUSION_SEQUENCE std::tuple
+#define FUSION_TRAVERSAL_TAG random_access_traversal_tag
+#include "./iterator.hpp"
+
+int
+main()
+{
+ test();
+ return boost::report_errors();
+}
+
+#else
+
+int
+main()
+{
+ return 0;
+}
+
+#endif
+

Modified: trunk/libs/fusion/test/sequence/vector_iterator.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/vector_iterator.cpp (original)
+++ trunk/libs/fusion/test/sequence/vector_iterator.cpp 2011-09-24 09:07:24 EDT (Sat, 24 Sep 2011)
@@ -1,7 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2011 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
 #include <boost/fusion/container/vector/vector.hpp>


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