Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49456 - trunk/libs/fusion/test/compile_time
From: danmarsden_at_[hidden]
Date: 2008-10-26 10:39:59


Author: danmarsden
Date: 2008-10-26 10:39:59 EDT (Sun, 26 Oct 2008)
New Revision: 49456
URL: http://svn.boost.org/trac/boost/changeset/49456

Log:
added fold test and simplified repetition in the Makefile
Added:
   trunk/libs/fusion/test/compile_time/fold.cpp (contents, props changed)
Properties modified:
   trunk/libs/fusion/test/compile_time/ (props changed)
Text files modified:
   trunk/libs/fusion/test/compile_time/Makefile | 20 ++++++++++++--------
   1 files changed, 12 insertions(+), 8 deletions(-)

Modified: trunk/libs/fusion/test/compile_time/Makefile
==============================================================================
--- trunk/libs/fusion/test/compile_time/Makefile (original)
+++ trunk/libs/fusion/test/compile_time/Makefile 2008-10-26 10:39:59 EDT (Sun, 26 Oct 2008)
@@ -9,16 +9,20 @@
 CXX=g++
 CXXFLAGS=-I$(BOOST_ROOT)
 
-all: vector_construction vector_iteration vector_intrinsic
+TEST_SRCS=\
+ vector_construction.cpp\
+ vector_iteration.cpp\
+ vector_intrinsic.cpp\
+ fold.cpp
 
-vector_construction: vector_construction.cpp
- time $(CXX) $(CXXFLAGS) vector_construction.cpp -o vector_construction
+TEST_OBJS=$(TEST_SRCS:.cpp=.o)
 
-vector_iteration: vector_iteration.cpp
- time $(CXX) $(CXXFLAGS) vector_iteration.cpp -o vector_iteration
+TEST_TARGETS=$(TEST_SRCS:.cpp=.test)
 
-vector_intrinsic: vector_intrinsic.cpp
- time $(CXX) $(CXXFLAGS) vector_intrinsic.cpp -o vector_intrinsic
+all: $(TEST_TARGETS)
+
+%.test : %.cpp
+ time $(CXX) $(CXXFLAGS) $< -o $@
 
 clean:
- rm -f vector_construction vector_construction.o vector_iteration vector_iteration.o vector_intrinsic vector_intrinsic.o
+ rm -f $(TEST_TARGETS) $(TEST_OBJS)

Added: trunk/libs/fusion/test/compile_time/fold.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/fusion/test/compile_time/fold.cpp 2008-10-26 10:39:59 EDT (Sun, 26 Oct 2008)
@@ -0,0 +1,31 @@
+/*=============================================================================
+ Copyright (c) 2008 Dan Marsden
+
+ Use modification and distribution are subject to 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/include/fold.hpp>
+#include <boost/fusion/include/vector.hpp>
+
+namespace fusion = boost::fusion;
+
+namespace
+{
+ template<int n, int batch>
+ struct distinct
+ {
+ static const int value = n;
+ };
+
+ template<int batch>
+ void test()
+ {
+ fusion::vector<
+ distinct<0, batch>, distinct<1, batch>, distinct<2, batch>, distinct<3, batch>, distinct<4, batch>,
+ distinct<5, batch>, distinct<6, batch>, distinct<7, batch>, distinct<8, batch>, distinct<9, batch> > v;
+ }
+}
+
+#include "./driver.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