12 #ifndef BOOST_MPL11_MAYBE_HPP
13 #define BOOST_MPL11_MAYBE_HPP
25 namespace boost {
namespace mpl11 {
29 using mpl_datatype = Maybe;
31 template <
typename def,
typename f>
32 using maybe_ =
typename f::type::template
apply<x>;
37 using mpl_datatype = Maybe;
39 template <
typename def,
typename f>
43 template <
typename def,
typename f,
typename m>
45 : m::type::template maybe_<def, f>
48 namespace maybe_detail {
49 template <
typename ...dum>
50 struct err_from_just {
51 static_assert(detail::dependent<dum...>::value(
false),
52 "Using from_just on a nothing.");
59 struct Functor<Maybe> : instantiate<Functor>::with<Maybe> {
60 template <
typename f,
typename m>
61 using fmap_impl =
typename m::template maybe_<nothing, f>;
65 template <
typename T,
typename U>
66 struct Comparable<Maybe<T>, Maybe<U>, typename Comparable<T, U>::type>
67 : instantiate<Comparable>::with<Maybe<T>, Maybe<U>>
69 template <
typename x,
typename y>
71 : equal_impl<typename x::type, typename y::type>
75 struct equal_impl<nothing, nothing>
79 template <
typename x,
typename y>
80 struct equal_impl<just<x>, just<y>>
87 #endif // !BOOST_MPL11_MAYBE_HPP
Forward declares the Maybe datatype.
Defines the fmap method of the Functor typeclass.
Defines boost::mpl11::detail::dependent.
Invokes a metafunction class with the given arguments.
Definition: functional.hpp:39
Forwards to boost/mpl11/integer.hpp.
Defines the Functional module.