|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73687 - trunk/libs/fusion/test/algorithm
From: joel_at_[hidden]
Date: 2011-08-12 01:15:09
Author: djowel
Date: 2011-08-12 01:15:08 EDT (Fri, 12 Aug 2011)
New Revision: 73687
URL: http://svn.boost.org/trac/boost/changeset/73687
Log:
Added Eric's test cases for pop_back
Text files modified:
trunk/libs/fusion/test/algorithm/pop_back.cpp | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
Modified: trunk/libs/fusion/test/algorithm/pop_back.cpp
==============================================================================
--- trunk/libs/fusion/test/algorithm/pop_back.cpp (original)
+++ trunk/libs/fusion/test/algorithm/pop_back.cpp 2011-08-12 01:15:08 EDT (Fri, 12 Aug 2011)
@@ -13,6 +13,8 @@
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/container/generation/make_list.hpp>
#include <boost/fusion/algorithm/transformation/pop_back.hpp>
+#include <boost/fusion/algorithm/transformation/push_back.hpp>
+#include <boost/fusion/algorithm/query/find.hpp>
#include <boost/mpl/vector_c.hpp>
int
@@ -55,12 +57,40 @@
BOOST_TEST((pop_back(l) == make_list()));
}
+ {
+ single_view<int> sv(1);
+ std::cout << pop_back(sv) << std::endl;
+
+ // Compile check only
+ begin(pop_back(sv)) == end(sv);
+ end(pop_back(sv)) == begin(sv);
+ }
+
// $$$ JDG: TODO add compile fail facility $$$
//~ { // compile fail check (Disabled for now)
//~ list<> l;
//~ std::cout << pop_back(l) << std::endl;
//~ }
+#ifndef BOOST_NO_DECLTYPE
+ {
+ auto vec = make_vector(1, 3.14, "hello");
+
+ // Compile check only
+ auto popv = pop_back(vec);
+ std::cout << popv << std::endl;
+
+ auto push = push_back(vec, 42);
+ auto pop = pop_back(vec);
+ auto i1 = find<int>(popv);
+ auto i2 = find<double>(pop);
+
+ assert(i1 != end(pop));
+ assert(i2 != end(pop));
+ assert(i1 != i2);
+ }
+#endif
+
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