17#ifndef OASIS_MATCHCAST_HPP
18#define OASIS_MATCHCAST_HPP
20#include <boost/mpl/for_each.hpp>
21#include <boost/mpl/push_back.hpp>
22#include <boost/mpl/vector.hpp>
31template <
typename Ret,
typename ClassType,
typename Arg>
36template <
typename Lambda>
39template <
typename ArgumentT,
typename Cases>
42 template <
typename Lambda>
52 boost::mpl::for_each<Cases>([&]<
typename CaseTrueCallbackT>(CaseTrueCallbackT caseTrueCallback) {
57 result = caseTrueCallback(*castResult);
59 return result ? std::move(result) : std::move(fallback);
63template <
typename ArgumentT>
Definition MatchCast.hpp:40
std::unique_ptr< ArgumentT > Execute(const ArgumentT &arg, std::unique_ptr< ArgumentT > &&fallback) const
Definition MatchCast.hpp:49
MatchCastImpl< ArgumentT, typename boost::mpl::push_back< Cases, Lambda >::type > Case(Lambda) const
Definition MatchCast.hpp:44
typename lambda_traits< decltype(&Lambda::operator())>::argument_type lambda_argument_type
Definition MatchCast.hpp:37
Definition MatchCast.hpp:29