2
0
mirror of https://github.com/boostorg/yap.git synced 2026-02-25 17:02:19 +00:00

Add expression_function.

This commit is contained in:
Zach Laine
2016-11-18 19:46:49 -06:00
parent e7957852dc
commit f52633f0fb

View File

@@ -289,6 +289,20 @@ namespace boost::proto17 {
};
}
template <expr_kind Kind, typename ...T>
struct expression_function
{
template <typename ...U>
decltype(auto) operator() (U &&... u)
{ return evaluate(expr, static_cast<U &&>(u)...); }
expression<Kind, T...> expr;
};
template <expr_kind Kind, typename ...T>
auto make_expression_function (expression<Kind, T...> && expr)
{ return expression_function<Kind, T...>{std::move(expr)}; }
}
#include "detail/default_eval.hpp"