[Monads] extract pointer_like category and the specialization for value_traits to a pointer_like.hpp
Closed this issue · 1 comments
viboes commented
namespace category
{
struct pointer_like {};
}
template <>
struct value_traits<category::pointer_like> {
template <class M>
using type = typename M::value_type;
template <class M>
static constexpr bool has_value(M&& m) { return bool(m); };
template <class M>
static constexpr auto derreference(M&& m) -> decltype(*m) { return *m; };
};