12 #ifndef BOOST_MPL11_DETAIL_TEST_FUNCTOR_HPP
13 #define BOOST_MPL11_DETAIL_TEST_FUNCTOR_HPP
22 namespace boost {
namespace mpl11 {
namespace detail {
23 namespace functor_detail {
24 template <
typename ...x>
25 struct f {
using type = f<
typename x::type...>; };
27 struct x0 {
using type = x0; };
28 struct x1 {
using type = x1; };
29 struct x2 {
using type = x2; };
30 struct x3 {
using type = x3; };
31 struct x4 {
using type = x4; };
34 template <
template <
typename ...>
class s>
36 template <
typename ...xs>
37 using _fmap = fmap<lift<f>, s<xs...>>;
40 : expect<_fmap<>>::template to_eq<s<>>
41 , expect<_fmap<x0>>::template to_eq<s<f<x0>>>
42 , expect<_fmap<x0, x1>>::template to_eq<s<f<x0>, f<x1>>>
43 , expect<_fmap<x0, x1, x2>>::template to_eq<s<f<x0>, f<x1>, f<x2>>>
44 , expect<_fmap<x0, x1, x2, x3>>::template
45 to_eq<s<f<x0>, f<x1>, f<x2>, f<x3>>>
46 , expect<_fmap<x0, x1, x2, x3, x4>>::template
47 to_eq<s<f<x0>, f<x1>, f<x2>, f<x3>, f<x4>>>
50 static_assert(
sizeof(go),
"");
53 template <
template <
typename ...>
class functor>
54 struct test_datatype {
55 template <
typename ...xs>
56 using _datatype =
typename expect<
57 typename datatype<
typename functor<xs...>::type>::type
58 >::template to_satisfy<lift<mpl11::Functor>>;
62 sizeof(_datatype<u>) +
63 sizeof(_datatype<u, u>) +
64 sizeof(_datatype<u, u, u>)
69 template <
template <
typename ...>
class functor>
71 : functor_detail::test_fmap<functor>
72 , functor_detail::test_datatype<functor>
76 #endif // !BOOST_MPL11_DETAIL_TEST_FUNCTOR_HPP
Defines the fmap method of the Functor typeclass.
Defines utilities to write unit tests.
Defines the Functional module.