]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/fusion/test/sequence/repetitive_view.cpp
1 /*=============================================================================
2 Copyright (c) 2007 Tobias Schwinger
4 Use modification and distribution are subject to the Boost Software
5 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt).
7 ==============================================================================*/
9 #include <boost/detail/lightweight_test.hpp>
10 #include <boost/fusion/view/repetitive_view.hpp>
12 #include <boost/fusion/container/vector.hpp>
13 #include <boost/fusion/view/joint_view.hpp>
14 #include <boost/fusion/algorithm/transformation/zip.hpp>
15 #include <boost/fusion/algorithm/iteration/for_each.hpp>
17 #include <boost/type_traits/is_same.hpp>
19 #include <boost/fusion/sequence/intrinsic/begin.hpp>
20 #include <boost/fusion/iterator/next.hpp>
22 #include <boost/fusion/functional/generation/make_fused_procedure.hpp>
26 template<typename LHS
, typename RHS
>
27 void operator()(LHS
const& lhs
, RHS
const& rhs
) const
29 BOOST_TEST(( boost::is_same
<LHS
,RHS
>::value
));
30 BOOST_TEST(( lhs
== rhs
));
36 using namespace boost::fusion
;
38 typedef boost::fusion::vector
<int,long,float,double> seq_t
;
39 seq_t
seq(1,2l,3.0f
,4.0);
41 typedef repetitive_view
<seq_t
> view_t
;
44 typedef joint_view
<seq_t
,seq_t
> seq_twice_t
;
45 typedef joint_view
<seq_t
,seq_twice_t
> seq_repeated_t
;
46 seq_twice_t
seq_twice(seq
,seq
);
47 seq_repeated_t
seq_repeated(seq
,seq_twice
);
49 for_each(zip(view
,seq_repeated
), make_fused_procedure(check_equal()));
51 return boost::report_errors();