7 #ifndef BOOST_MPL11_TEST_CHECK_FINITE_ITERABLE_HPP
8 #define BOOST_MPL11_TEST_CHECK_FINITE_ITERABLE_HPP
18 namespace check_finite_iter_detail {
19 using namespace boost::mpl11;
22 template <
typename x,
typename y,
23 typename Expected =
typename x::type,
24 typename Actual =
typename y::type>
27 template <
typename reference,
typename iter,
32 template <
typename reference,
typename iter>
33 struct impl<reference, iter,
size_t<
length<reference>::value>, false>
34 : assert_eq<head<reference>, head<iter>>
35 , assert_eq<tail<reference>, tail<iter>>
36 , assert_eq<is_empty<reference>, is_empty<iter>>
38 , assert_eq<last<reference>, last<iter>>
39 , assert_eq<length<reference>, length<iter>>
42 template <
typename reference,
typename iter,
typename index>
43 struct impl<reference, iter, index, false>
44 : assert_eq<at<index, reference>, at<index, iter>>
45 , impl<reference, iter, size_t<index::type::value + 1>>
48 template <
typename reference,
typename iter,
typename index>
49 struct impl<reference, iter, index, true>
51 , assert_eq<size_t<0>, length<iter>>
63 template <
typename iter,
typename ...xs>
67 #endif // !BOOST_MPL11_TEST_CHECK_FINITE_ITERABLE_HPP
Defines the Integer datatype.
Defines the minimal_iterable helper for unit tests.
Forward declares the Iterable typeclass.
Minimal iterable for testing purposes.
Definition: minimal_iterable.hpp:26
Returns whether the iterable is empty.
Definition: iterable.hpp:101
check_finite_iter_detail::impl< minimal_iterable< xs...>, iter > check_finite_iterable
Generic unit test for finite iterables.
Definition: check_finite_iterable.hpp:65
Alias to integer_c; provided for convenience.
Definition: integer.hpp:122
Forward declares the Comparable typeclass.
Defines the static_assert_ helper for unit tests.
Returns the given boolean expression and statically asserts that its value is true.
Definition: static_assert.hpp:22
Returns the number of elements in a finite iterable.
Definition: iterable.hpp:89