|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57890 - sandbox/variadic_templates/libs/mpl/test
From: cppljevans_at_[hidden]
Date: 2009-11-24 10:11:00
Author: cppljevans
Date: 2009-11-24 10:11:00 EST (Tue, 24 Nov 2009)
New Revision: 57890
URL: http://svn.boost.org/trac/boost/changeset/57890
Log:
Add missing test for fold_assoc_pack.hpp
Added:
sandbox/variadic_templates/libs/mpl/test/fold_assoc_pack.cpp (contents, props changed)
Added: sandbox/variadic_templates/libs/mpl/test/fold_assoc_pack.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/mpl/test/fold_assoc_pack.cpp 2009-11-24 10:11:00 EST (Tue, 24 Nov 2009)
@@ -0,0 +1,45 @@
+
+// Copyright Larry Evans 2009
+//
+// $Id$
+// $Date: 2009/11/13 17:02:07 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/fold_assoc_pack.hpp>
+#include <boost/mpl/pair.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/mpl/aux_/test.hpp>
+
+//assoc_left:
+
+MPL_TEST_CASE()
+{
+ typedef int_<0> z;
+ {
+ typedef fold_assoc_pack<assoc_left,pair,z,int_<1>,int_<2> >::type result;
+ typedef pair<pair<z,int_<1> >,int_<2> > answer;
+ MPL_ASSERT(( is_same<answer,result> ));
+ }
+ {
+ typedef fold_assoc_pack<assoc_left,pair,z>::type result;
+ MPL_ASSERT(( is_same<z,result> ));
+ }
+}
+
+//assoc_right:
+
+MPL_TEST_CASE()
+{
+ typedef int_<3> z;
+ {
+ typedef fold_assoc_pack<assoc_right,pair,z,int_<1>,int_<2> >::type result;
+ typedef pair<int_<1>,pair<int_<2>,z> > answer;
+ MPL_ASSERT(( is_same<answer,result> ));
+ }
+ {
+ typedef fold_assoc_pack<assoc_right,pair,z>::type result;
+ MPL_ASSERT(( is_same<z,result> ));
+ }
+}
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