From dda826b95cefd85e8bd6d0a15838c611566bf3a9 Mon Sep 17 00:00:00 2001 From: Zach Laine Date: Wed, 30 Nov 2016 23:42:38 -0600 Subject: [PATCH] proto17 -> yap --- detail/default_eval.hpp | 116 +++---- detail/expression.hpp | 6 +- example/calc1.cpp | 2 +- example/calc2a.cpp | 2 +- example/calc2b.cpp | 2 +- example/calc3.cpp | 14 +- example/hello_world.cpp | 2 +- example/lazy_vector.cpp | 32 +- example/tarray.cpp | 66 ++-- example/vec3.cpp | 24 +- example/vector.cpp | 54 +-- expression.hpp | 282 ++++++++-------- expression_fwd.hpp | 6 +- operators.hpp | 310 +++++++++--------- perf/code_gen_samples.cpp | 14 +- print.hpp | 12 +- test/call_expr.cpp | 96 +++--- test/compile_const_term.cpp | 58 ++-- test/compile_copy_only_types.cpp | 16 +- test/compile_is_expr.cpp | 56 ++-- test/compile_move_only_types.cpp | 22 +- test/compile_placeholders.cpp | 28 +- test/compile_term_plus_expr.cpp | 306 ++++++++--------- test/compile_term_plus_term.cpp | 132 ++++---- test/compile_term_plus_x.cpp | 88 ++--- ...compile_term_plus_x_this_ref_overloads.cpp | 88 ++--- test/compile_x_plus_term.cpp | 88 ++--- test/default_eval.cpp | 40 +-- test/depth_stress_test_left.cpp | 6 +- test/depth_stress_test_right.cpp | 6 +- test/deref.cpp | 114 +++---- test/left.cpp | 146 ++++----- test/placeholder_eval.cpp | 26 +- test/print.cpp | 68 ++-- test/reference_returns.cpp | 8 +- test/right.cpp | 102 +++--- test/user_eval_expression_as.cpp | 32 +- test/user_expression_transform.cpp | 46 +-- test/user_expression_transform_2.cpp | 14 +- test/user_expression_transform_3.cpp | 96 +++--- test/user_operator_and_eval_expression_as.cpp | 32 +- test/user_operator_eval.cpp | 24 +- test/value.cpp | 90 ++--- user_macros.hpp | 252 +++++++------- 44 files changed, 1512 insertions(+), 1512 deletions(-) diff --git a/detail/default_eval.hpp b/detail/default_eval.hpp index 12d8236..8a5010d 100644 --- a/detail/default_eval.hpp +++ b/detail/default_eval.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_PROTO17_DETAIL_DEFAULT_EVAL_HPP_INCLUDED -#define BOOST_PROTO17_DETAIL_DEFAULT_EVAL_HPP_INCLUDED +#ifndef BOOST_YAP_DETAIL_DEFAULT_EVAL_HPP_INCLUDED +#define BOOST_YAP_DETAIL_DEFAULT_EVAL_HPP_INCLUDED #include "../expression_fwd.hpp" #include "../operators.hpp" @@ -9,7 +9,7 @@ #include -namespace boost::proto17 { +namespace boost::yap { namespace detail { @@ -52,14 +52,14 @@ namespace boost::proto17 { ) { return transform_expression(expr, static_cast(args)...); } else if constexpr (kind == expr_kind::expr_ref) { - return default_eval_expr(::boost::proto17::value(expr), static_cast(args)...); + return default_eval_expr(::boost::yap::value(expr), static_cast(args)...); } else if constexpr (kind == expr_kind::terminal) { - return ::boost::proto17::value(expr); + return ::boost::yap::value(expr); } else if constexpr (kind == expr_kind::placeholder) { - return eval_placeholder(::boost::proto17::value(expr), static_cast(args)...); + return eval_placeholder(::boost::yap::value(expr), static_cast(args)...); } -#define BOOST_PROTO17_UNARY_OPERATOR_CASE(op_name) \ +#define BOOST_YAP_UNARY_OPERATOR_CASE(op_name) \ else if constexpr (kind == expr_kind:: op_name) { \ return \ eval_ ## op_name( \ @@ -67,20 +67,20 @@ namespace boost::proto17 { ); \ } - BOOST_PROTO17_UNARY_OPERATOR_CASE(unary_plus) // + - BOOST_PROTO17_UNARY_OPERATOR_CASE(negate) // - - BOOST_PROTO17_UNARY_OPERATOR_CASE(dereference) // * - BOOST_PROTO17_UNARY_OPERATOR_CASE(complement) // ~ - BOOST_PROTO17_UNARY_OPERATOR_CASE(address_of) // & - BOOST_PROTO17_UNARY_OPERATOR_CASE(logical_not) // ! - BOOST_PROTO17_UNARY_OPERATOR_CASE(pre_inc) // ++ - BOOST_PROTO17_UNARY_OPERATOR_CASE(pre_dec) // -- - BOOST_PROTO17_UNARY_OPERATOR_CASE(post_inc) // ++(int) - BOOST_PROTO17_UNARY_OPERATOR_CASE(post_dec) // --(int) + BOOST_YAP_UNARY_OPERATOR_CASE(unary_plus) // + + BOOST_YAP_UNARY_OPERATOR_CASE(negate) // - + BOOST_YAP_UNARY_OPERATOR_CASE(dereference) // * + BOOST_YAP_UNARY_OPERATOR_CASE(complement) // ~ + BOOST_YAP_UNARY_OPERATOR_CASE(address_of) // & + BOOST_YAP_UNARY_OPERATOR_CASE(logical_not) // ! + BOOST_YAP_UNARY_OPERATOR_CASE(pre_inc) // ++ + BOOST_YAP_UNARY_OPERATOR_CASE(pre_dec) // -- + BOOST_YAP_UNARY_OPERATOR_CASE(post_inc) // ++(int) + BOOST_YAP_UNARY_OPERATOR_CASE(post_dec) // --(int) -#undef BOOST_PROTO17_UNARY_OPERATOR_CASE +#undef BOOST_YAP_UNARY_OPERATOR_CASE -#define BOOST_PROTO17_BINARY_OPERATOR_CASE(op_name) \ +#define BOOST_YAP_BINARY_OPERATOR_CASE(op_name) \ else if constexpr (kind == expr_kind:: op_name) { \ return \ eval_ ## op_name( \ @@ -89,24 +89,24 @@ namespace boost::proto17 { ); \ } - BOOST_PROTO17_BINARY_OPERATOR_CASE(shift_left) // << - BOOST_PROTO17_BINARY_OPERATOR_CASE(shift_right) // >> - BOOST_PROTO17_BINARY_OPERATOR_CASE(multiplies) // * - BOOST_PROTO17_BINARY_OPERATOR_CASE(divides) // / - BOOST_PROTO17_BINARY_OPERATOR_CASE(modulus) // % - BOOST_PROTO17_BINARY_OPERATOR_CASE(plus) // + - BOOST_PROTO17_BINARY_OPERATOR_CASE(minus) // - - BOOST_PROTO17_BINARY_OPERATOR_CASE(less) // < - BOOST_PROTO17_BINARY_OPERATOR_CASE(greater) // > - BOOST_PROTO17_BINARY_OPERATOR_CASE(less_equal) // <= - BOOST_PROTO17_BINARY_OPERATOR_CASE(greater_equal) // >= - BOOST_PROTO17_BINARY_OPERATOR_CASE(equal_to) // == - BOOST_PROTO17_BINARY_OPERATOR_CASE(not_equal_to) // != - BOOST_PROTO17_BINARY_OPERATOR_CASE(logical_or) // || - BOOST_PROTO17_BINARY_OPERATOR_CASE(logical_and) // && - BOOST_PROTO17_BINARY_OPERATOR_CASE(bitwise_and) // & - BOOST_PROTO17_BINARY_OPERATOR_CASE(bitwise_or) // | - BOOST_PROTO17_BINARY_OPERATOR_CASE(bitwise_xor) // ^ + BOOST_YAP_BINARY_OPERATOR_CASE(shift_left) // << + BOOST_YAP_BINARY_OPERATOR_CASE(shift_right) // >> + BOOST_YAP_BINARY_OPERATOR_CASE(multiplies) // * + BOOST_YAP_BINARY_OPERATOR_CASE(divides) // / + BOOST_YAP_BINARY_OPERATOR_CASE(modulus) // % + BOOST_YAP_BINARY_OPERATOR_CASE(plus) // + + BOOST_YAP_BINARY_OPERATOR_CASE(minus) // - + BOOST_YAP_BINARY_OPERATOR_CASE(less) // < + BOOST_YAP_BINARY_OPERATOR_CASE(greater) // > + BOOST_YAP_BINARY_OPERATOR_CASE(less_equal) // <= + BOOST_YAP_BINARY_OPERATOR_CASE(greater_equal) // >= + BOOST_YAP_BINARY_OPERATOR_CASE(equal_to) // == + BOOST_YAP_BINARY_OPERATOR_CASE(not_equal_to) // != + BOOST_YAP_BINARY_OPERATOR_CASE(logical_or) // || + BOOST_YAP_BINARY_OPERATOR_CASE(logical_and) // && + BOOST_YAP_BINARY_OPERATOR_CASE(bitwise_and) // & + BOOST_YAP_BINARY_OPERATOR_CASE(bitwise_or) // | + BOOST_YAP_BINARY_OPERATOR_CASE(bitwise_xor) // ^ else if constexpr (kind == expr_kind::comma) { return @@ -116,19 +116,19 @@ namespace boost::proto17 { ); } - BOOST_PROTO17_BINARY_OPERATOR_CASE(mem_ptr) // ->* - BOOST_PROTO17_BINARY_OPERATOR_CASE(assign) // = - BOOST_PROTO17_BINARY_OPERATOR_CASE(shift_left_assign) // <<= - BOOST_PROTO17_BINARY_OPERATOR_CASE(shift_right_assign) // >>= - BOOST_PROTO17_BINARY_OPERATOR_CASE(multiplies_assign) // *= - BOOST_PROTO17_BINARY_OPERATOR_CASE(divides_assign) // /= - BOOST_PROTO17_BINARY_OPERATOR_CASE(modulus_assign) // %= - BOOST_PROTO17_BINARY_OPERATOR_CASE(plus_assign) // += - BOOST_PROTO17_BINARY_OPERATOR_CASE(minus_assign) // -= - BOOST_PROTO17_BINARY_OPERATOR_CASE(bitwise_and_assign) // &= - BOOST_PROTO17_BINARY_OPERATOR_CASE(bitwise_or_assign) // |= - BOOST_PROTO17_BINARY_OPERATOR_CASE(bitwise_xor_assign) // ^= - BOOST_PROTO17_BINARY_OPERATOR_CASE(subscript) // [] + BOOST_YAP_BINARY_OPERATOR_CASE(mem_ptr) // ->* + BOOST_YAP_BINARY_OPERATOR_CASE(assign) // = + BOOST_YAP_BINARY_OPERATOR_CASE(shift_left_assign) // <<= + BOOST_YAP_BINARY_OPERATOR_CASE(shift_right_assign) // >>= + BOOST_YAP_BINARY_OPERATOR_CASE(multiplies_assign) // *= + BOOST_YAP_BINARY_OPERATOR_CASE(divides_assign) // /= + BOOST_YAP_BINARY_OPERATOR_CASE(modulus_assign) // %= + BOOST_YAP_BINARY_OPERATOR_CASE(plus_assign) // += + BOOST_YAP_BINARY_OPERATOR_CASE(minus_assign) // -= + BOOST_YAP_BINARY_OPERATOR_CASE(bitwise_and_assign) // &= + BOOST_YAP_BINARY_OPERATOR_CASE(bitwise_or_assign) // |= + BOOST_YAP_BINARY_OPERATOR_CASE(bitwise_xor_assign) // ^= + BOOST_YAP_BINARY_OPERATOR_CASE(subscript) // [] else if constexpr (kind == expr_kind::if_else) { return @@ -139,7 +139,7 @@ namespace boost::proto17 { ); } -#undef BOOST_PROTO17_BINARY_OPERATOR_CASE +#undef BOOST_YAP_BINARY_OPERATOR_CASE else if constexpr (kind == expr_kind::call) { auto expand_args = [&](auto && element) { @@ -172,7 +172,7 @@ namespace boost::proto17 { { constexpr expr_kind kind = remove_cv_ref_t::kind; if constexpr (kind == expr_kind::expr_ref) { - decltype(auto) ref = ::boost::proto17::value(expr); + decltype(auto) ref = ::boost::yap::value(expr); constexpr expr_kind kind = remove_cv_ref_t::kind; default_transform_expression()> transformer; return transformer(ref, static_cast(transform)); @@ -216,7 +216,7 @@ namespace boost::proto17 { std::void_t()( detail::tag_for::kind>(), - deref(::boost::proto17::value(std::declval())) + deref(::boost::yap::value(std::declval())) ) )> > @@ -225,7 +225,7 @@ namespace boost::proto17 { { return static_cast(transform)( detail::tag_for::kind>(), - deref(::boost::proto17::value(static_cast(expr))) + deref(::boost::yap::value(static_cast(expr))) ); } }; @@ -238,8 +238,8 @@ namespace boost::proto17 { std::void_t()( detail::tag_for::kind>(), - deref(::boost::proto17::left(std::declval())), - deref(::boost::proto17::right(std::declval())) + deref(::boost::yap::left(std::declval())), + deref(::boost::yap::right(std::declval())) ) )> > @@ -248,8 +248,8 @@ namespace boost::proto17 { { return static_cast(transform)( detail::tag_for::kind>(), - deref(::boost::proto17::left(static_cast(expr))), - deref(::boost::proto17::right(static_cast(expr))) + deref(::boost::yap::left(static_cast(expr))), + deref(::boost::yap::right(static_cast(expr))) ); } }; diff --git a/detail/expression.hpp b/detail/expression.hpp index c396c74..a92d979 100644 --- a/detail/expression.hpp +++ b/detail/expression.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_PROTO17_DETAIL_EXPRESSION_HPP_INCLUDED -#define BOOST_PROTO17_DETAIL_EXPRESSION_HPP_INCLUDED +#ifndef BOOST_YAP_DETAIL_EXPRESSION_HPP_INCLUDED +#define BOOST_YAP_DETAIL_EXPRESSION_HPP_INCLUDED #include "../expression_fwd.hpp" @@ -9,7 +9,7 @@ #include -namespace boost::proto17 { +namespace boost::yap { namespace detail { diff --git a/example/calc1.cpp b/example/calc1.cpp index dcb7fff..2b562c3 100644 --- a/example/calc1.cpp +++ b/example/calc1.cpp @@ -5,7 +5,7 @@ int main () { - using namespace boost::proto17::literals; + using namespace boost::yap::literals; // Displays "5" std::cout << evaluate( 1_p + 2.0, 3.0 ) << std::endl; diff --git a/example/calc2a.cpp b/example/calc2a.cpp index 10c4d1b..722b745 100644 --- a/example/calc2a.cpp +++ b/example/calc2a.cpp @@ -5,7 +5,7 @@ int main () { - using namespace boost::proto17::literals; + using namespace boost::yap::literals; auto expr_1 = 1_p + 2.0; diff --git a/example/calc2b.cpp b/example/calc2b.cpp index d31e031..0345035 100644 --- a/example/calc2b.cpp +++ b/example/calc2b.cpp @@ -5,7 +5,7 @@ int main () { - using namespace boost::proto17::literals; + using namespace boost::yap::literals; // Displays "5" std::cout << make_expression_function(1_p + 2.0)(3.0) << std::endl; diff --git a/example/calc3.cpp b/example/calc3.cpp index 83c17ed..8a09404 100644 --- a/example/calc3.cpp +++ b/example/calc3.cpp @@ -10,9 +10,9 @@ struct get_arity template auto operator() (Expr const & expr) { - if constexpr (Expr::kind == boost::proto17::expr_kind::placeholder) { + if constexpr (Expr::kind == boost::yap::expr_kind::placeholder) { return expr.value(); - } else if constexpr (Expr::kind == boost::proto17::expr_kind::terminal) { + } else if constexpr (Expr::kind == boost::yap::expr_kind::terminal) { using namespace boost::hana::literals; return 0_c; } else { @@ -20,7 +20,7 @@ struct get_arity boost::hana::transform( expr.elements, [](auto const & element) { - return boost::proto17::transform(element, get_arity{}); + return boost::yap::transform(element, get_arity{}); } ) ); @@ -30,12 +30,12 @@ struct get_arity int main () { - using namespace boost::proto17::literals; + using namespace boost::yap::literals; auto expr_1 = 1_p + 2.0; auto expr_1_fn = [expr_1](auto &&... args) { - auto const arity = boost::proto17::transform(expr_1, get_arity{}); + auto const arity = boost::yap::transform(expr_1, get_arity{}); static_assert(arity.value == sizeof...(args), "Called with wrong number of args."); return evaluate(expr_1, args...); }; @@ -43,7 +43,7 @@ int main () auto expr_2 = 1_p * 2_p; auto expr_2_fn = [expr_2](auto &&... args) { - auto const arity = boost::proto17::transform(expr_2, get_arity{}); + auto const arity = boost::yap::transform(expr_2, get_arity{}); static_assert(arity.value == sizeof...(args), "Called with wrong number of args."); return evaluate(expr_2, args...); }; @@ -51,7 +51,7 @@ int main () auto expr_3 = (1_p - 2_p) / 2_p; auto expr_3_fn = [expr_3](auto &&... args) { - auto const arity = boost::proto17::transform(expr_3, get_arity{}); + auto const arity = boost::yap::transform(expr_3, get_arity{}); static_assert(arity.value == sizeof...(args), "Called with wrong number of args."); return evaluate(expr_3, args...); }; diff --git a/example/hello_world.cpp b/example/hello_world.cpp index 671ee4b..a56f6b4 100644 --- a/example/hello_world.cpp +++ b/example/hello_world.cpp @@ -5,7 +5,7 @@ int main () { - evaluate(boost::proto17::make_terminal(std::cout) << "Hello" << ',' << " world!\n"); + evaluate(boost::yap::make_terminal(std::cout) << "Hello" << ',' << " world!\n"); return 0; } diff --git a/example/lazy_vector.cpp b/example/lazy_vector.cpp index 6134825..39beea9 100644 --- a/example/lazy_vector.cpp +++ b/example/lazy_vector.cpp @@ -1,4 +1,4 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include @@ -9,51 +9,51 @@ // TODO: Turn this into a test that counts the number of allocations. -template +template struct lazy_vector_expr; struct take_nth { - boost::proto17::terminal - operator() (boost::proto17::terminal, lazy_vector_expr> const & expr); + boost::yap::terminal + operator() (boost::yap::terminal, lazy_vector_expr> const & expr); std::size_t n; }; -template +template struct lazy_vector_expr { using this_type = lazy_vector_expr; - static const boost::proto17::expr_kind kind = Kind; + static const boost::yap::expr_kind kind = Kind; Tuple elements; - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::lazy_vector_expr) - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(minus, this_type, ::lazy_vector_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::lazy_vector_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(minus, this_type, ::lazy_vector_expr) auto operator[] (std::size_t n) const - { return boost::proto17::evaluate(boost::proto17::transform(*this, take_nth{n})); } + { return boost::yap::evaluate(boost::yap::transform(*this, take_nth{n})); } }; -boost::proto17::terminal -take_nth::operator() (boost::proto17::terminal, lazy_vector_expr> const & expr) +boost::yap::terminal +take_nth::operator() (boost::yap::terminal, lazy_vector_expr> const & expr) { - double x = boost::proto17::value(expr)[n]; - return boost::proto17::make_terminal(std::move(x)); + double x = boost::yap::value(expr)[n]; + return boost::yap::make_terminal(std::move(x)); } struct lazy_vector : lazy_vector_expr< - boost::proto17::expr_kind::terminal, + boost::yap::expr_kind::terminal, boost::hana::tuple> > { - template + template lazy_vector & operator+= (lazy_vector_expr const & rhs) { - std::vector & this_vec = boost::proto17::value(*this); + std::vector & this_vec = boost::yap::value(*this); for (int i = 0, size = (int)this_vec.size(); i < size; ++i) { this_vec[i] += rhs[i]; } diff --git a/example/tarray.cpp b/example/tarray.cpp index 6cfc515..b932e9e 100644 --- a/example/tarray.cpp +++ b/example/tarray.cpp @@ -4,23 +4,23 @@ #include -template +template struct tarray_expr; struct take_nth { - boost::proto17::terminal - operator() (boost::proto17::terminal, tarray_expr> const & expr); + boost::yap::terminal + operator() (boost::yap::terminal, tarray_expr> const & expr); std::size_t n; }; -template +template struct tarray_expr { static_assert( - Kind != boost::proto17::expr_kind::terminal || + Kind != boost::yap::expr_kind::terminal || std::is_same>{} || std::is_same>{} || std::is_same>{} || @@ -29,60 +29,60 @@ struct tarray_expr using this_type = tarray_expr; - static const boost::proto17::expr_kind kind = Kind; + static const boost::yap::expr_kind kind = Kind; Tuple elements; - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::tarray_expr) - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(minus, this_type, ::tarray_expr) - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(multiplies, this_type, ::tarray_expr) - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(divides, this_type, ::tarray_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::tarray_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(minus, this_type, ::tarray_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(multiplies, this_type, ::tarray_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(divides, this_type, ::tarray_expr) int operator[] (std::size_t n) const - { return boost::proto17::evaluate(boost::proto17::transform(*this, take_nth{n})); } + { return boost::yap::evaluate(boost::yap::transform(*this, take_nth{n})); } }; -BOOST_PROTO17_USER_FREE_BINARY_OPERATOR(plus, ::tarray_expr) -BOOST_PROTO17_USER_FREE_BINARY_OPERATOR(minus, ::tarray_expr) -BOOST_PROTO17_USER_FREE_BINARY_OPERATOR(multiplies, ::tarray_expr) -BOOST_PROTO17_USER_FREE_BINARY_OPERATOR(divides, ::tarray_expr) +BOOST_YAP_USER_FREE_BINARY_OPERATOR(plus, ::tarray_expr) +BOOST_YAP_USER_FREE_BINARY_OPERATOR(minus, ::tarray_expr) +BOOST_YAP_USER_FREE_BINARY_OPERATOR(multiplies, ::tarray_expr) +BOOST_YAP_USER_FREE_BINARY_OPERATOR(divides, ::tarray_expr) -boost::proto17::terminal -take_nth::operator() (boost::proto17::terminal, tarray_expr> const & expr) +boost::yap::terminal +take_nth::operator() (boost::yap::terminal, tarray_expr> const & expr) { - int x = boost::proto17::value(expr)[n]; - return boost::proto17::make_terminal(std::move(x)); + int x = boost::yap::value(expr)[n]; + return boost::yap::make_terminal(std::move(x)); } -std::ostream & operator<< (std::ostream & os, boost::proto17::terminal expr) -{ return os << '{' << boost::proto17::value(expr) << '}'; } +std::ostream & operator<< (std::ostream & os, boost::yap::terminal expr) +{ return os << '{' << boost::yap::value(expr) << '}'; } -std::ostream & operator<< (std::ostream & os, boost::proto17::terminal, tarray_expr> expr) +std::ostream & operator<< (std::ostream & os, boost::yap::terminal, tarray_expr> expr) { - std::array const & a = boost::proto17::value(expr); + std::array const & a = boost::yap::value(expr); return os << '{' << a[0] << ", " << a[1] << ", " << a[2] << '}'; } template -std::ostream & operator<< (std::ostream & os, tarray_expr const & expr) -{ return os << boost::proto17::value(expr); } +std::ostream & operator<< (std::ostream & os, tarray_expr const & expr) +{ return os << boost::yap::value(expr); } -template +template std::ostream & operator<< (std::ostream & os, tarray_expr const & expr) { - if (Kind == boost::proto17::expr_kind::plus || Kind == boost::proto17::expr_kind::minus) + if (Kind == boost::yap::expr_kind::plus || Kind == boost::yap::expr_kind::minus) os << '('; - os << boost::proto17::left(expr) << " " << op_string(Kind) << " " << boost::proto17::right(expr); - if (Kind == boost::proto17::expr_kind::plus || Kind == boost::proto17::expr_kind::minus) + os << boost::yap::left(expr) << " " << op_string(Kind) << " " << boost::yap::right(expr); + if (Kind == boost::yap::expr_kind::plus || Kind == boost::yap::expr_kind::minus) os << ')'; return os; } struct tarray : tarray_expr< - boost::proto17::expr_kind::terminal, + boost::yap::expr_kind::terminal, boost::hana::tuple> > { @@ -101,14 +101,14 @@ struct tarray : } int & operator[] (std::ptrdiff_t i) - { return boost::proto17::value(*this)[i]; } + { return boost::yap::value(*this)[i]; } int const & operator[] (std::ptrdiff_t i) const - { return boost::proto17::value(*this)[i]; } + { return boost::yap::value(*this)[i]; } template tarray & operator= (T const & t) - { return assign(boost::proto17::as_expr< ::tarray_expr>(t)); } + { return assign(boost::yap::as_expr< ::tarray_expr>(t)); } template tarray & printAssign (Expr const & expr) diff --git a/example/vec3.cpp b/example/vec3.cpp index 239d229..144b424 100644 --- a/example/vec3.cpp +++ b/example/vec3.cpp @@ -6,17 +6,17 @@ struct take_nth { - auto operator() (boost::proto17::terminal> const & expr) + auto operator() (boost::yap::terminal> const & expr) { - int x = boost::proto17::value(expr)[n]; - return boost::proto17::make_terminal(std::move(x)); + int x = boost::yap::value(expr)[n]; + return boost::yap::make_terminal(std::move(x)); } std::size_t n; }; -using vec3_terminal = boost::proto17::expression< - boost::proto17::expr_kind::terminal, +using vec3_terminal = boost::yap::expression< + boost::yap::expr_kind::terminal, boost::hana::tuple> >; @@ -37,18 +37,18 @@ struct vec3 : vec3_terminal } int & operator[] (std::ptrdiff_t i) - { return boost::proto17::value(*this)[i]; } + { return boost::yap::value(*this)[i]; } int const & operator[] (std::ptrdiff_t i) const - { return boost::proto17::value(*this)[i]; } + { return boost::yap::value(*this)[i]; } template vec3 & operator= (T const & t) { - decltype(auto) expr = boost::proto17::as_expr(t); - (*this)[0] = boost::proto17::evaluate(boost::proto17::transform(expr, take_nth{0})); - (*this)[1] = boost::proto17::evaluate(boost::proto17::transform(expr, take_nth{1})); - (*this)[2] = boost::proto17::evaluate(boost::proto17::transform(expr, take_nth{2})); + decltype(auto) expr = boost::yap::as_expr(t); + (*this)[0] = boost::yap::evaluate(boost::yap::transform(expr, take_nth{0})); + (*this)[1] = boost::yap::evaluate(boost::yap::transform(expr, take_nth{1})); + (*this)[2] = boost::yap::evaluate(boost::yap::transform(expr, take_nth{2})); return *this; } @@ -76,7 +76,7 @@ template int count_leaves (Expr const & expr) { count_leaves_impl impl; - boost::proto17::transform(expr, impl); + boost::yap::transform(expr, impl); return impl.value; } diff --git a/example/vector.cpp b/example/vector.cpp index 9ba653d..dc8fcd2 100644 --- a/example/vector.cpp +++ b/example/vector.cpp @@ -7,15 +7,15 @@ struct take_nth { template - auto operator() (boost::proto17::terminal_tag, std::vector const & vec) - { return boost::proto17::make_terminal(std::move(vec[n])); } + auto operator() (boost::yap::terminal_tag, std::vector const & vec) + { return boost::yap::make_terminal(std::move(vec[n])); } std::size_t n; }; template -using vector_terminal = boost::proto17::expression< - boost::proto17::expr_kind::terminal, +using vector_terminal = boost::yap::expression< + boost::yap::expr_kind::terminal, boost::hana::tuple> >; @@ -24,7 +24,7 @@ struct equal_sizes_impl template auto operator() (vector_terminal const & expr) { - auto const expr_size = boost::proto17::value(expr).size(); + auto const expr_size = boost::yap::value(expr).size(); if (expr_size != size) value = false; return expr; @@ -38,7 +38,7 @@ template bool equal_sizes (std::size_t size, Expr const & expr) { equal_sizes_impl impl{size, true}; - boost::proto17::transform(expr, impl); + boost::yap::transform(expr, impl); return impl.value; } @@ -46,10 +46,10 @@ bool equal_sizes (std::size_t size, Expr const & expr) template std::vector & assign (std::vector & vec, Expr const & e) { - decltype(auto) expr = boost::proto17::as_expr(e); + decltype(auto) expr = boost::yap::as_expr(e); assert(equal_sizes(vec.size(), expr)); for (std::size_t i = 0, size = vec.size(); i < size; ++i) { - vec[i] = boost::proto17::evaluate(boost::proto17::transform(expr, take_nth{i})); + vec[i] = boost::yap::evaluate(boost::yap::transform(expr, take_nth{i})); } return vec; } @@ -57,10 +57,10 @@ std::vector & assign (std::vector & vec, Expr const & e) template std::vector & operator+= (std::vector & vec, Expr const & e) { - decltype(auto) expr = boost::proto17::as_expr(e); + decltype(auto) expr = boost::yap::as_expr(e); assert(equal_sizes(vec.size(), expr)); for (std::size_t i = 0, size = vec.size(); i < size; ++i) { - vec[i] += boost::proto17::evaluate(boost::proto17::transform(expr, take_nth{i})); + vec[i] += boost::yap::evaluate(boost::yap::transform(expr, take_nth{i})); } return vec; } @@ -71,23 +71,23 @@ struct is_vector : std::false_type {}; template struct is_vector> : std::true_type {}; -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(negate, boost::proto17::expression, is_vector); // - -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(multiplies, boost::proto17::expression, is_vector); // * -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(divides, boost::proto17::expression, is_vector); // / -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(modulus, boost::proto17::expression, is_vector); // % -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(plus, boost::proto17::expression, is_vector); // + -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(minus, boost::proto17::expression, is_vector); // - -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(less, boost::proto17::expression, is_vector); // < -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(greater, boost::proto17::expression, is_vector); // > -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(less_equal, boost::proto17::expression, is_vector); // <= -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(greater_equal, boost::proto17::expression, is_vector); // >= -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(equal_to, boost::proto17::expression, is_vector); // == -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(not_equal_to, boost::proto17::expression, is_vector); // != -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(logical_or, boost::proto17::expression, is_vector); // || -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(logical_and, boost::proto17::expression, is_vector); // && -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(bitwise_and, boost::proto17::expression, is_vector); // & -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(bitwise_or, boost::proto17::expression, is_vector); // | -BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(bitwise_xor, boost::proto17::expression, is_vector); // ^ +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(negate, boost::yap::expression, is_vector); // - +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(multiplies, boost::yap::expression, is_vector); // * +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(divides, boost::yap::expression, is_vector); // / +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(modulus, boost::yap::expression, is_vector); // % +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(plus, boost::yap::expression, is_vector); // + +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(minus, boost::yap::expression, is_vector); // - +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(less, boost::yap::expression, is_vector); // < +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(greater, boost::yap::expression, is_vector); // > +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(less_equal, boost::yap::expression, is_vector); // <= +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(greater_equal, boost::yap::expression, is_vector); // >= +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(equal_to, boost::yap::expression, is_vector); // == +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(not_equal_to, boost::yap::expression, is_vector); // != +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(logical_or, boost::yap::expression, is_vector); // || +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(logical_and, boost::yap::expression, is_vector); // && +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(bitwise_and, boost::yap::expression, is_vector); // & +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(bitwise_or, boost::yap::expression, is_vector); // | +BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(bitwise_xor, boost::yap::expression, is_vector); // ^ int main() { diff --git a/expression.hpp b/expression.hpp index baac859..b46ce1e 100644 --- a/expression.hpp +++ b/expression.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_PROTO17_EXPRESSION_HPP_INCLUDED -#define BOOST_PROTO17_EXPRESSION_HPP_INCLUDED +#ifndef BOOST_YAP_EXPRESSION_HPP_INCLUDED +#define BOOST_YAP_EXPRESSION_HPP_INCLUDED #include "expression_fwd.hpp" #include "user_macros.hpp" @@ -9,7 +9,7 @@ #include -namespace boost::proto17 { +namespace boost::yap { namespace adl_detail { @@ -104,97 +104,97 @@ namespace boost::proto17 { tuple_type elements; -#ifdef BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#ifdef BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE template operator R () { return eval_expression_as(*this, hana::basic_type{}); } #endif decltype(auto) value () const & - { return ::boost::proto17::value(*this); } + { return ::boost::yap::value(*this); } decltype(auto) value () & - { return ::boost::proto17::value(*this); } + { return ::boost::yap::value(*this); } decltype(auto) value () && - { return ::boost::proto17::value(std::move(*this)); } + { return ::boost::yap::value(std::move(*this)); } decltype(auto) left () const & - { return ::boost::proto17::left(*this); } + { return ::boost::yap::left(*this); } decltype(auto) left () & - { return ::boost::proto17::left(*this); } + { return ::boost::yap::left(*this); } decltype(auto) left () && - { return ::boost::proto17::left(std::move(*this)); } + { return ::boost::yap::left(std::move(*this)); } decltype(auto) right () const & - { return ::boost::proto17::right(*this); } + { return ::boost::yap::right(*this); } decltype(auto) right () & - { return ::boost::proto17::right(*this); } + { return ::boost::yap::right(*this); } decltype(auto) right () && - { return ::boost::proto17::right(std::move(*this)); } + { return ::boost::yap::right(std::move(*this)); } -#define BOOST_PROTO17_UNARY_MEMBER_OPERATOR(op_name) \ - BOOST_PROTO17_USER_UNARY_OPERATOR_MEMBER(op_name, this_type, ::boost::proto17::expression) +#define BOOST_YAP_UNARY_MEMBER_OPERATOR(op_name) \ + BOOST_YAP_USER_UNARY_OPERATOR_MEMBER(op_name, this_type, ::boost::yap::expression) - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(unary_plus) // + - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(negate) // - - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(dereference) // * - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(complement) // ~ - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(address_of) // & - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(logical_not) // ! - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(pre_inc) // ++ - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(pre_dec) // -- - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(post_inc) // ++(int) - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(post_dec) // --(int) + BOOST_YAP_UNARY_MEMBER_OPERATOR(unary_plus) // + + BOOST_YAP_UNARY_MEMBER_OPERATOR(negate) // - + BOOST_YAP_UNARY_MEMBER_OPERATOR(dereference) // * + BOOST_YAP_UNARY_MEMBER_OPERATOR(complement) // ~ + BOOST_YAP_UNARY_MEMBER_OPERATOR(address_of) // & + BOOST_YAP_UNARY_MEMBER_OPERATOR(logical_not) // ! + BOOST_YAP_UNARY_MEMBER_OPERATOR(pre_inc) // ++ + BOOST_YAP_UNARY_MEMBER_OPERATOR(pre_dec) // -- + BOOST_YAP_UNARY_MEMBER_OPERATOR(post_inc) // ++(int) + BOOST_YAP_UNARY_MEMBER_OPERATOR(post_dec) // --(int) -#undef BOOST_PROTO17_UNARY_MEMBER_OPERATOR +#undef BOOST_YAP_UNARY_MEMBER_OPERATOR // TODO: Add test coverage for all the operators (with all three qual // types), for expression and terminal. Don't forget the free // operators. -#define BOOST_PROTO17_BINARY_MEMBER_OPERATOR(op_name) \ - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(op_name, this_type, ::boost::proto17::expression) +#define BOOST_YAP_BINARY_MEMBER_OPERATOR(op_name) \ + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(op_name, this_type, ::boost::yap::expression) - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(shift_left) // << - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(shift_right) // >> - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(multiplies) // * - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(divides) // / - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(modulus) // % - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(plus) // + - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(minus) // - - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(less) // < - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(greater) // > - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(less_equal) // <= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(greater_equal) // >= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(equal_to) // == - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(not_equal_to) // != - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(logical_or) // || - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(logical_and) // && - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_and) // & - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_or) // | - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_xor) // ^ - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(comma) // , - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(mem_ptr) // ->* - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(assign) // = - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(shift_left_assign) // <<= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(shift_right_assign) // >>= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(multiplies_assign) // *= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(divides_assign) // /= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(modulus_assign) // %= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(plus_assign) // += - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(minus_assign) // -= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_and_assign) // &= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_or_assign) // |= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_xor_assign) // ^= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(subscript) // [] + BOOST_YAP_BINARY_MEMBER_OPERATOR(shift_left) // << + BOOST_YAP_BINARY_MEMBER_OPERATOR(shift_right) // >> + BOOST_YAP_BINARY_MEMBER_OPERATOR(multiplies) // * + BOOST_YAP_BINARY_MEMBER_OPERATOR(divides) // / + BOOST_YAP_BINARY_MEMBER_OPERATOR(modulus) // % + BOOST_YAP_BINARY_MEMBER_OPERATOR(plus) // + + BOOST_YAP_BINARY_MEMBER_OPERATOR(minus) // - + BOOST_YAP_BINARY_MEMBER_OPERATOR(less) // < + BOOST_YAP_BINARY_MEMBER_OPERATOR(greater) // > + BOOST_YAP_BINARY_MEMBER_OPERATOR(less_equal) // <= + BOOST_YAP_BINARY_MEMBER_OPERATOR(greater_equal) // >= + BOOST_YAP_BINARY_MEMBER_OPERATOR(equal_to) // == + BOOST_YAP_BINARY_MEMBER_OPERATOR(not_equal_to) // != + BOOST_YAP_BINARY_MEMBER_OPERATOR(logical_or) // || + BOOST_YAP_BINARY_MEMBER_OPERATOR(logical_and) // && + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_and) // & + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_or) // | + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_xor) // ^ + BOOST_YAP_BINARY_MEMBER_OPERATOR(comma) // , + BOOST_YAP_BINARY_MEMBER_OPERATOR(mem_ptr) // ->* + BOOST_YAP_BINARY_MEMBER_OPERATOR(assign) // = + BOOST_YAP_BINARY_MEMBER_OPERATOR(shift_left_assign) // <<= + BOOST_YAP_BINARY_MEMBER_OPERATOR(shift_right_assign) // >>= + BOOST_YAP_BINARY_MEMBER_OPERATOR(multiplies_assign) // *= + BOOST_YAP_BINARY_MEMBER_OPERATOR(divides_assign) // /= + BOOST_YAP_BINARY_MEMBER_OPERATOR(modulus_assign) // %= + BOOST_YAP_BINARY_MEMBER_OPERATOR(plus_assign) // += + BOOST_YAP_BINARY_MEMBER_OPERATOR(minus_assign) // -= + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_and_assign) // &= + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_or_assign) // |= + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_xor_assign) // ^= + BOOST_YAP_BINARY_MEMBER_OPERATOR(subscript) // [] -#undef BOOST_PROTO17_BINARY_MEMBER_OPERATOR +#undef BOOST_YAP_BINARY_MEMBER_OPERATOR - BOOST_PROTO17_USER_MEMBER_CALL_OPERATOR(this_type, ::boost::proto17::expression) + BOOST_YAP_USER_MEMBER_CALL_OPERATOR(this_type, ::boost::yap::expression) }; template @@ -217,76 +217,76 @@ namespace boost::proto17 { tuple_type elements; -#ifdef BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#ifdef BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE template operator R () { return eval_expression_as(*this, hana::basic_type{}); } #endif decltype(auto) value () const & - { return ::boost::proto17::value(*this); } + { return ::boost::yap::value(*this); } decltype(auto) value () & - { return ::boost::proto17::value(*this); } + { return ::boost::yap::value(*this); } decltype(auto) value () && - { return ::boost::proto17::value(std::move(*this)); } + { return ::boost::yap::value(std::move(*this)); } -#define BOOST_PROTO17_UNARY_MEMBER_OPERATOR(op_name) \ - BOOST_PROTO17_USER_UNARY_OPERATOR_MEMBER(op_name, this_type, ::boost::proto17::expression) +#define BOOST_YAP_UNARY_MEMBER_OPERATOR(op_name) \ + BOOST_YAP_USER_UNARY_OPERATOR_MEMBER(op_name, this_type, ::boost::yap::expression) - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(unary_plus) // + - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(negate) // - - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(dereference) // * - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(complement) // ~ - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(address_of) // & - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(logical_not) // ! - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(pre_inc) // ++ - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(pre_dec) // -- - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(post_inc) // ++(int) - BOOST_PROTO17_UNARY_MEMBER_OPERATOR(post_dec) // --(int) + BOOST_YAP_UNARY_MEMBER_OPERATOR(unary_plus) // + + BOOST_YAP_UNARY_MEMBER_OPERATOR(negate) // - + BOOST_YAP_UNARY_MEMBER_OPERATOR(dereference) // * + BOOST_YAP_UNARY_MEMBER_OPERATOR(complement) // ~ + BOOST_YAP_UNARY_MEMBER_OPERATOR(address_of) // & + BOOST_YAP_UNARY_MEMBER_OPERATOR(logical_not) // ! + BOOST_YAP_UNARY_MEMBER_OPERATOR(pre_inc) // ++ + BOOST_YAP_UNARY_MEMBER_OPERATOR(pre_dec) // -- + BOOST_YAP_UNARY_MEMBER_OPERATOR(post_inc) // ++(int) + BOOST_YAP_UNARY_MEMBER_OPERATOR(post_dec) // --(int) -#undef BOOST_PROTO17_UNARY_MEMBER_OPERATOR +#undef BOOST_YAP_UNARY_MEMBER_OPERATOR -#define BOOST_PROTO17_BINARY_MEMBER_OPERATOR(op_name) \ - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(op_name, this_type, ::boost::proto17::expression) +#define BOOST_YAP_BINARY_MEMBER_OPERATOR(op_name) \ + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(op_name, this_type, ::boost::yap::expression) - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(shift_left) // << - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(shift_right) // >> - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(multiplies) // * - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(divides) // / - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(modulus) // % - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(plus) // + - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(minus) // - - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(less) // < - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(greater) // > - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(less_equal) // <= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(greater_equal) // >= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(equal_to) // == - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(not_equal_to) // != - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(logical_or) // || - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(logical_and) // && - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_and) // & - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_or) // | - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_xor) // ^ - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(comma) // , - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(mem_ptr) // ->* - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(assign) // = - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(shift_left_assign) // <<= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(shift_right_assign) // >>= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(multiplies_assign) // *= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(divides_assign) // /= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(modulus_assign) // %= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(plus_assign) // += - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(minus_assign) // -= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_and_assign) // &= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_or_assign) // |= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(bitwise_xor_assign) // ^= - BOOST_PROTO17_BINARY_MEMBER_OPERATOR(subscript) // [] + BOOST_YAP_BINARY_MEMBER_OPERATOR(shift_left) // << + BOOST_YAP_BINARY_MEMBER_OPERATOR(shift_right) // >> + BOOST_YAP_BINARY_MEMBER_OPERATOR(multiplies) // * + BOOST_YAP_BINARY_MEMBER_OPERATOR(divides) // / + BOOST_YAP_BINARY_MEMBER_OPERATOR(modulus) // % + BOOST_YAP_BINARY_MEMBER_OPERATOR(plus) // + + BOOST_YAP_BINARY_MEMBER_OPERATOR(minus) // - + BOOST_YAP_BINARY_MEMBER_OPERATOR(less) // < + BOOST_YAP_BINARY_MEMBER_OPERATOR(greater) // > + BOOST_YAP_BINARY_MEMBER_OPERATOR(less_equal) // <= + BOOST_YAP_BINARY_MEMBER_OPERATOR(greater_equal) // >= + BOOST_YAP_BINARY_MEMBER_OPERATOR(equal_to) // == + BOOST_YAP_BINARY_MEMBER_OPERATOR(not_equal_to) // != + BOOST_YAP_BINARY_MEMBER_OPERATOR(logical_or) // || + BOOST_YAP_BINARY_MEMBER_OPERATOR(logical_and) // && + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_and) // & + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_or) // | + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_xor) // ^ + BOOST_YAP_BINARY_MEMBER_OPERATOR(comma) // , + BOOST_YAP_BINARY_MEMBER_OPERATOR(mem_ptr) // ->* + BOOST_YAP_BINARY_MEMBER_OPERATOR(assign) // = + BOOST_YAP_BINARY_MEMBER_OPERATOR(shift_left_assign) // <<= + BOOST_YAP_BINARY_MEMBER_OPERATOR(shift_right_assign) // >>= + BOOST_YAP_BINARY_MEMBER_OPERATOR(multiplies_assign) // *= + BOOST_YAP_BINARY_MEMBER_OPERATOR(divides_assign) // /= + BOOST_YAP_BINARY_MEMBER_OPERATOR(modulus_assign) // %= + BOOST_YAP_BINARY_MEMBER_OPERATOR(plus_assign) // += + BOOST_YAP_BINARY_MEMBER_OPERATOR(minus_assign) // -= + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_and_assign) // &= + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_or_assign) // |= + BOOST_YAP_BINARY_MEMBER_OPERATOR(bitwise_xor_assign) // ^= + BOOST_YAP_BINARY_MEMBER_OPERATOR(subscript) // [] -#undef BOOST_PROTO17_BINARY_MEMBER_OPERATOR +#undef BOOST_YAP_BINARY_MEMBER_OPERATOR - BOOST_PROTO17_USER_MEMBER_CALL_OPERATOR(this_type, ::boost::proto17::expression) + BOOST_YAP_USER_MEMBER_CALL_OPERATOR(this_type, ::boost::yap::expression) }; template @@ -297,7 +297,7 @@ namespace boost::proto17 { { if constexpr (detail::is_expr::value) { if constexpr (detail::remove_cv_ref_t::kind == expr_kind::expr_ref) { - return ::boost::proto17::value(::boost::proto17::value(static_cast(x))); + return ::boost::yap::value(::boost::yap::value(static_cast(x))); } else { return static_cast(x); } @@ -346,7 +346,7 @@ namespace boost::proto17 { using namespace hana::literals; constexpr expr_kind kind = detail::remove_cv_ref_t::kind; if constexpr (kind == expr_kind::expr_ref) { - return left(::boost::proto17::value(static_cast(expr))); + return left(::boost::yap::value(static_cast(expr))); } else { static_assert( detail::arity_of() == detail::expr_arity::two, @@ -371,7 +371,7 @@ namespace boost::proto17 { using namespace hana::literals; constexpr expr_kind kind = detail::remove_cv_ref_t::kind; if constexpr (kind == expr_kind::expr_ref) { - return right(::boost::proto17::value(static_cast(expr))); + return right(::boost::yap::value(static_cast(expr))); } else { static_assert( detail::arity_of() == detail::expr_arity::two, @@ -385,31 +385,31 @@ namespace boost::proto17 { } } -#define BOOST_PROTO17_BINARY_FREE_OPERATOR(op_name) \ - BOOST_PROTO17_USER_FREE_BINARY_OPERATOR(op_name, expression) +#define BOOST_YAP_BINARY_FREE_OPERATOR(op_name) \ + BOOST_YAP_USER_FREE_BINARY_OPERATOR(op_name, expression) - BOOST_PROTO17_BINARY_FREE_OPERATOR(shift_left) // << - BOOST_PROTO17_BINARY_FREE_OPERATOR(shift_right) // >> - BOOST_PROTO17_BINARY_FREE_OPERATOR(multiplies) // * - BOOST_PROTO17_BINARY_FREE_OPERATOR(divides) // / - BOOST_PROTO17_BINARY_FREE_OPERATOR(modulus) // % - BOOST_PROTO17_BINARY_FREE_OPERATOR(plus) // + - BOOST_PROTO17_BINARY_FREE_OPERATOR(minus) // - - BOOST_PROTO17_BINARY_FREE_OPERATOR(less) // < - BOOST_PROTO17_BINARY_FREE_OPERATOR(greater) // > - BOOST_PROTO17_BINARY_FREE_OPERATOR(less_equal) // <= - BOOST_PROTO17_BINARY_FREE_OPERATOR(greater_equal) // >= - BOOST_PROTO17_BINARY_FREE_OPERATOR(equal_to) // == - BOOST_PROTO17_BINARY_FREE_OPERATOR(not_equal_to) // != - BOOST_PROTO17_BINARY_FREE_OPERATOR(logical_or) // || - BOOST_PROTO17_BINARY_FREE_OPERATOR(logical_and) // && - BOOST_PROTO17_BINARY_FREE_OPERATOR(bitwise_and) // & - BOOST_PROTO17_BINARY_FREE_OPERATOR(bitwise_or) // | - BOOST_PROTO17_BINARY_FREE_OPERATOR(bitwise_xor) // ^ + BOOST_YAP_BINARY_FREE_OPERATOR(shift_left) // << + BOOST_YAP_BINARY_FREE_OPERATOR(shift_right) // >> + BOOST_YAP_BINARY_FREE_OPERATOR(multiplies) // * + BOOST_YAP_BINARY_FREE_OPERATOR(divides) // / + BOOST_YAP_BINARY_FREE_OPERATOR(modulus) // % + BOOST_YAP_BINARY_FREE_OPERATOR(plus) // + + BOOST_YAP_BINARY_FREE_OPERATOR(minus) // - + BOOST_YAP_BINARY_FREE_OPERATOR(less) // < + BOOST_YAP_BINARY_FREE_OPERATOR(greater) // > + BOOST_YAP_BINARY_FREE_OPERATOR(less_equal) // <= + BOOST_YAP_BINARY_FREE_OPERATOR(greater_equal) // >= + BOOST_YAP_BINARY_FREE_OPERATOR(equal_to) // == + BOOST_YAP_BINARY_FREE_OPERATOR(not_equal_to) // != + BOOST_YAP_BINARY_FREE_OPERATOR(logical_or) // || + BOOST_YAP_BINARY_FREE_OPERATOR(logical_and) // && + BOOST_YAP_BINARY_FREE_OPERATOR(bitwise_and) // & + BOOST_YAP_BINARY_FREE_OPERATOR(bitwise_or) // | + BOOST_YAP_BINARY_FREE_OPERATOR(bitwise_xor) // ^ -#undef BOOST_PROTO17_BINARY_FREE_OPERATOR +#undef BOOST_YAP_BINARY_FREE_OPERATOR - BOOST_PROTO17_USER_EXPR_IF_ELSE(::boost::proto17::expression) + BOOST_YAP_USER_EXPR_IF_ELSE(::boost::yap::expression) template auto make_expression (T &&... t) @@ -501,7 +501,7 @@ namespace boost::proto17 { #include "detail/default_eval.hpp" -namespace boost::proto17 { +namespace boost::yap { template decltype(auto) evaluate (Expr const & expr, T && ...t) diff --git a/expression_fwd.hpp b/expression_fwd.hpp index 26091d0..947464b 100644 --- a/expression_fwd.hpp +++ b/expression_fwd.hpp @@ -1,11 +1,11 @@ -#ifndef BOOST_PROTO17_EXPRESSION_FWD_HPP_INCLUDED -#define BOOST_PROTO17_EXPRESSION_FWD_HPP_INCLUDED +#ifndef BOOST_YAP_EXPRESSION_FWD_HPP_INCLUDED +#define BOOST_YAP_EXPRESSION_FWD_HPP_INCLUDED #include #include -namespace boost::proto17 { +namespace boost::yap { enum class expr_kind { expr_ref, diff --git a/operators.hpp b/operators.hpp index acd0aa3..e702aae 100644 --- a/operators.hpp +++ b/operators.hpp @@ -1,261 +1,261 @@ -#ifndef BOOST_PROTO17_OPERATORS_HPP_INCLUDED -#define BOOST_PROTO17_OPERATORS_HPP_INCLUDED +#ifndef BOOST_YAP_OPERATORS_HPP_INCLUDED +#define BOOST_YAP_OPERATORS_HPP_INCLUDED -namespace boost::proto17 { +namespace boost::yap { -#define BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN(expr) \ +#define BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN(expr) \ noexcept(noexcept(expr)) -> decltype(expr) { return expr; } namespace adl_detail { -#define BOOST_PROTO17_UNARY_OPERATOR(op, op_name) \ +#define BOOST_YAP_UNARY_OPERATOR(op, op_name) \ template \ - constexpr auto eval_ ## op_name (T && t) BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( \ + constexpr auto eval_ ## op_name (T && t) BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( \ op static_cast(t) \ ) \ struct eval_ ## op_name ## _fn \ { \ template \ - constexpr auto operator() (T && t) const BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( \ + constexpr auto operator() (T && t) const BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( \ eval_ ## op_name(static_cast(t)) \ ) \ }; - BOOST_PROTO17_UNARY_OPERATOR(+, unary_plus) // + - BOOST_PROTO17_UNARY_OPERATOR(-, negate) // - - BOOST_PROTO17_UNARY_OPERATOR(*, dereference) // * - BOOST_PROTO17_UNARY_OPERATOR(~, complement) // ~ - BOOST_PROTO17_UNARY_OPERATOR(&, address_of) // & - BOOST_PROTO17_UNARY_OPERATOR(!, logical_not) // ! - BOOST_PROTO17_UNARY_OPERATOR(++, pre_inc) // ++ - BOOST_PROTO17_UNARY_OPERATOR(--, pre_dec) // -- + BOOST_YAP_UNARY_OPERATOR(+, unary_plus) // + + BOOST_YAP_UNARY_OPERATOR(-, negate) // - + BOOST_YAP_UNARY_OPERATOR(*, dereference) // * + BOOST_YAP_UNARY_OPERATOR(~, complement) // ~ + BOOST_YAP_UNARY_OPERATOR(&, address_of) // & + BOOST_YAP_UNARY_OPERATOR(!, logical_not) // ! + BOOST_YAP_UNARY_OPERATOR(++, pre_inc) // ++ + BOOST_YAP_UNARY_OPERATOR(--, pre_dec) // -- template - constexpr auto eval_post_inc (T && t) BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto eval_post_inc (T && t) BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( static_cast(t) ++ ) struct eval_post_inc_fn { template - constexpr auto operator() (T && t) const BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto operator() (T && t) const BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( eval_post_inc(static_cast(t)) ) }; template - constexpr auto eval_post_dec (T && t) BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto eval_post_dec (T && t) BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( static_cast(t) -- ) struct eval_post_dec_fn { template - constexpr auto operator() (T && t) const BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto operator() (T && t) const BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( eval_post_dec(static_cast(t)) ) }; -#undef BOOST_PROTO17_UNARY_OPERATOR +#undef BOOST_YAP_UNARY_OPERATOR -#define BOOST_PROTO17_BINARY_OPERATOR(op, op_name) \ +#define BOOST_YAP_BINARY_OPERATOR(op, op_name) \ template \ - constexpr auto eval_ ## op_name (T && t, U && u) BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( \ + constexpr auto eval_ ## op_name (T && t, U && u) BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( \ static_cast(t) op static_cast(u) \ ) \ struct eval_ ## op_name ## _fn \ { \ template \ - constexpr auto operator() (T && t, U && u) const BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( \ + constexpr auto operator() (T && t, U && u) const BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( \ eval_ ## op_name(static_cast(t), static_cast(u)) \ ) \ }; - BOOST_PROTO17_BINARY_OPERATOR(<<, shift_left) // << - BOOST_PROTO17_BINARY_OPERATOR(>>, shift_right) // >> - BOOST_PROTO17_BINARY_OPERATOR(*, multiplies) // * - BOOST_PROTO17_BINARY_OPERATOR(/, divides) // / - BOOST_PROTO17_BINARY_OPERATOR(%, modulus) // % - BOOST_PROTO17_BINARY_OPERATOR(+, plus) // + - BOOST_PROTO17_BINARY_OPERATOR(-, minus) // - - BOOST_PROTO17_BINARY_OPERATOR(<, less) // < - BOOST_PROTO17_BINARY_OPERATOR(>, greater) // > - BOOST_PROTO17_BINARY_OPERATOR(<=, less_equal) // <= - BOOST_PROTO17_BINARY_OPERATOR(>=, greater_equal) // >= - BOOST_PROTO17_BINARY_OPERATOR(==, equal_to) // == - BOOST_PROTO17_BINARY_OPERATOR(!=, not_equal_to) // != - BOOST_PROTO17_BINARY_OPERATOR(||, logical_or) // || - BOOST_PROTO17_BINARY_OPERATOR(&&, logical_and) // && - BOOST_PROTO17_BINARY_OPERATOR(&, bitwise_and) // & - BOOST_PROTO17_BINARY_OPERATOR(|, bitwise_or) // | - BOOST_PROTO17_BINARY_OPERATOR(^, bitwise_xor) // ^ + BOOST_YAP_BINARY_OPERATOR(<<, shift_left) // << + BOOST_YAP_BINARY_OPERATOR(>>, shift_right) // >> + BOOST_YAP_BINARY_OPERATOR(*, multiplies) // * + BOOST_YAP_BINARY_OPERATOR(/, divides) // / + BOOST_YAP_BINARY_OPERATOR(%, modulus) // % + BOOST_YAP_BINARY_OPERATOR(+, plus) // + + BOOST_YAP_BINARY_OPERATOR(-, minus) // - + BOOST_YAP_BINARY_OPERATOR(<, less) // < + BOOST_YAP_BINARY_OPERATOR(>, greater) // > + BOOST_YAP_BINARY_OPERATOR(<=, less_equal) // <= + BOOST_YAP_BINARY_OPERATOR(>=, greater_equal) // >= + BOOST_YAP_BINARY_OPERATOR(==, equal_to) // == + BOOST_YAP_BINARY_OPERATOR(!=, not_equal_to) // != + BOOST_YAP_BINARY_OPERATOR(||, logical_or) // || + BOOST_YAP_BINARY_OPERATOR(&&, logical_and) // && + BOOST_YAP_BINARY_OPERATOR(&, bitwise_and) // & + BOOST_YAP_BINARY_OPERATOR(|, bitwise_or) // | + BOOST_YAP_BINARY_OPERATOR(^, bitwise_xor) // ^ template - constexpr auto eval_comma (T && t, U && u) BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto eval_comma (T && t, U && u) BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( (static_cast(t) , static_cast(u)) ) struct eval_comma_fn { template - constexpr auto operator() (T && t, U && u) const BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto operator() (T && t, U && u) const BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( eval_comma(static_cast(t), static_cast(u)) ) }; - BOOST_PROTO17_BINARY_OPERATOR(->*, mem_ptr) // ->* - BOOST_PROTO17_BINARY_OPERATOR(=, assign) // = - BOOST_PROTO17_BINARY_OPERATOR(<<=, shift_left_assign) // <<= - BOOST_PROTO17_BINARY_OPERATOR(>>=, shift_right_assign) // >>= - BOOST_PROTO17_BINARY_OPERATOR(*=, multiplies_assign) // *= - BOOST_PROTO17_BINARY_OPERATOR(/=, divides_assign) // /= - BOOST_PROTO17_BINARY_OPERATOR(%=, modulus_assign) // %= - BOOST_PROTO17_BINARY_OPERATOR(+=, plus_assign) // += - BOOST_PROTO17_BINARY_OPERATOR(-=, minus_assign) // -= - BOOST_PROTO17_BINARY_OPERATOR(&=, bitwise_and_assign) // &= - BOOST_PROTO17_BINARY_OPERATOR(|=, bitwise_or_assign) // |= - BOOST_PROTO17_BINARY_OPERATOR(^=, bitwise_xor_assign) // ^= + BOOST_YAP_BINARY_OPERATOR(->*, mem_ptr) // ->* + BOOST_YAP_BINARY_OPERATOR(=, assign) // = + BOOST_YAP_BINARY_OPERATOR(<<=, shift_left_assign) // <<= + BOOST_YAP_BINARY_OPERATOR(>>=, shift_right_assign) // >>= + BOOST_YAP_BINARY_OPERATOR(*=, multiplies_assign) // *= + BOOST_YAP_BINARY_OPERATOR(/=, divides_assign) // /= + BOOST_YAP_BINARY_OPERATOR(%=, modulus_assign) // %= + BOOST_YAP_BINARY_OPERATOR(+=, plus_assign) // += + BOOST_YAP_BINARY_OPERATOR(-=, minus_assign) // -= + BOOST_YAP_BINARY_OPERATOR(&=, bitwise_and_assign) // &= + BOOST_YAP_BINARY_OPERATOR(|=, bitwise_or_assign) // |= + BOOST_YAP_BINARY_OPERATOR(^=, bitwise_xor_assign) // ^= template - constexpr auto eval_subscript (T && t, U && u) BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto eval_subscript (T && t, U && u) BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( static_cast(t)[static_cast(u)] ) struct eval_subscript_fn { template - constexpr auto operator() (T && t, U && u) const BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto operator() (T && t, U && u) const BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( eval_subscript(static_cast(t), static_cast(u)) ) }; -#undef BOOST_PROTO17_BINARY_OPERATOR +#undef BOOST_YAP_BINARY_OPERATOR template - constexpr auto eval_if_else (T && t, U && u, V && v) BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto eval_if_else (T && t, U && u, V && v) BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( static_cast(t) ? static_cast(u) : static_cast(v) ) struct eval_if_else_fn { template - constexpr auto operator() (T && t, U && u, V && v) const BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto operator() (T && t, U && u, V && v) const BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( eval_if_else(static_cast(t), static_cast(u), static_cast(v)) ) }; template - constexpr auto eval_call (F && f, T && ...t) BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto eval_call (F && f, T && ...t) BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( static_cast(f)(static_cast(t)...) ) struct eval_call_fn { template - constexpr auto operator() (F && f, T && ...t) const BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN( + constexpr auto operator() (F && f, T && ...t) const BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN( eval_call(static_cast(f), static_cast(t)...) ) }; } -#undef BOOST_PROTO17_NOEXCEPT_DECLTYPE_RETURN +#undef BOOST_YAP_NOEXCEPT_DECLTYPE_RETURN -#define BOOST_PROTO17_USING_OPERATOR_FN(op_name) using adl_detail::eval_ ## op_name ## _fn; +#define BOOST_YAP_USING_OPERATOR_FN(op_name) using adl_detail::eval_ ## op_name ## _fn; - BOOST_PROTO17_USING_OPERATOR_FN(unary_plus) // + - BOOST_PROTO17_USING_OPERATOR_FN(negate) // - - BOOST_PROTO17_USING_OPERATOR_FN(dereference) // * - BOOST_PROTO17_USING_OPERATOR_FN(complement) // ~ - BOOST_PROTO17_USING_OPERATOR_FN(address_of) // & - BOOST_PROTO17_USING_OPERATOR_FN(logical_not) // ! - BOOST_PROTO17_USING_OPERATOR_FN(pre_inc) // ++ - BOOST_PROTO17_USING_OPERATOR_FN(pre_dec) // -- - BOOST_PROTO17_USING_OPERATOR_FN(post_inc) // ++(int) - BOOST_PROTO17_USING_OPERATOR_FN(post_dec) // --(int) - BOOST_PROTO17_USING_OPERATOR_FN(shift_left) // << - BOOST_PROTO17_USING_OPERATOR_FN(shift_right) // >> - BOOST_PROTO17_USING_OPERATOR_FN(multiplies) // * - BOOST_PROTO17_USING_OPERATOR_FN(divides) // / - BOOST_PROTO17_USING_OPERATOR_FN(modulus) // % - BOOST_PROTO17_USING_OPERATOR_FN(plus) // + - BOOST_PROTO17_USING_OPERATOR_FN(minus) // - - BOOST_PROTO17_USING_OPERATOR_FN(less) // < - BOOST_PROTO17_USING_OPERATOR_FN(greater) // > - BOOST_PROTO17_USING_OPERATOR_FN(less_equal) // <= - BOOST_PROTO17_USING_OPERATOR_FN(greater_equal) // >= - BOOST_PROTO17_USING_OPERATOR_FN(equal_to) // == - BOOST_PROTO17_USING_OPERATOR_FN(not_equal_to) // != - BOOST_PROTO17_USING_OPERATOR_FN(logical_or) // || - BOOST_PROTO17_USING_OPERATOR_FN(logical_and) // && - BOOST_PROTO17_USING_OPERATOR_FN(bitwise_and) // & - BOOST_PROTO17_USING_OPERATOR_FN(bitwise_or) // | - BOOST_PROTO17_USING_OPERATOR_FN(bitwise_xor) // ^ - BOOST_PROTO17_USING_OPERATOR_FN(comma) // , - BOOST_PROTO17_USING_OPERATOR_FN(mem_ptr) // ->* - BOOST_PROTO17_USING_OPERATOR_FN(assign) // = - BOOST_PROTO17_USING_OPERATOR_FN(shift_left_assign) // <<= - BOOST_PROTO17_USING_OPERATOR_FN(shift_right_assign) // >>= - BOOST_PROTO17_USING_OPERATOR_FN(multiplies_assign) // *= - BOOST_PROTO17_USING_OPERATOR_FN(divides_assign) // /= - BOOST_PROTO17_USING_OPERATOR_FN(modulus_assign) // %= - BOOST_PROTO17_USING_OPERATOR_FN(plus_assign) // += - BOOST_PROTO17_USING_OPERATOR_FN(minus_assign) // -= - BOOST_PROTO17_USING_OPERATOR_FN(bitwise_and_assign) // &= - BOOST_PROTO17_USING_OPERATOR_FN(bitwise_or_assign) // |= - BOOST_PROTO17_USING_OPERATOR_FN(bitwise_xor_assign) // ^= - BOOST_PROTO17_USING_OPERATOR_FN(subscript) // [] - BOOST_PROTO17_USING_OPERATOR_FN(if_else) // (analogous to) ?: - BOOST_PROTO17_USING_OPERATOR_FN(call) // () + BOOST_YAP_USING_OPERATOR_FN(unary_plus) // + + BOOST_YAP_USING_OPERATOR_FN(negate) // - + BOOST_YAP_USING_OPERATOR_FN(dereference) // * + BOOST_YAP_USING_OPERATOR_FN(complement) // ~ + BOOST_YAP_USING_OPERATOR_FN(address_of) // & + BOOST_YAP_USING_OPERATOR_FN(logical_not) // ! + BOOST_YAP_USING_OPERATOR_FN(pre_inc) // ++ + BOOST_YAP_USING_OPERATOR_FN(pre_dec) // -- + BOOST_YAP_USING_OPERATOR_FN(post_inc) // ++(int) + BOOST_YAP_USING_OPERATOR_FN(post_dec) // --(int) + BOOST_YAP_USING_OPERATOR_FN(shift_left) // << + BOOST_YAP_USING_OPERATOR_FN(shift_right) // >> + BOOST_YAP_USING_OPERATOR_FN(multiplies) // * + BOOST_YAP_USING_OPERATOR_FN(divides) // / + BOOST_YAP_USING_OPERATOR_FN(modulus) // % + BOOST_YAP_USING_OPERATOR_FN(plus) // + + BOOST_YAP_USING_OPERATOR_FN(minus) // - + BOOST_YAP_USING_OPERATOR_FN(less) // < + BOOST_YAP_USING_OPERATOR_FN(greater) // > + BOOST_YAP_USING_OPERATOR_FN(less_equal) // <= + BOOST_YAP_USING_OPERATOR_FN(greater_equal) // >= + BOOST_YAP_USING_OPERATOR_FN(equal_to) // == + BOOST_YAP_USING_OPERATOR_FN(not_equal_to) // != + BOOST_YAP_USING_OPERATOR_FN(logical_or) // || + BOOST_YAP_USING_OPERATOR_FN(logical_and) // && + BOOST_YAP_USING_OPERATOR_FN(bitwise_and) // & + BOOST_YAP_USING_OPERATOR_FN(bitwise_or) // | + BOOST_YAP_USING_OPERATOR_FN(bitwise_xor) // ^ + BOOST_YAP_USING_OPERATOR_FN(comma) // , + BOOST_YAP_USING_OPERATOR_FN(mem_ptr) // ->* + BOOST_YAP_USING_OPERATOR_FN(assign) // = + BOOST_YAP_USING_OPERATOR_FN(shift_left_assign) // <<= + BOOST_YAP_USING_OPERATOR_FN(shift_right_assign) // >>= + BOOST_YAP_USING_OPERATOR_FN(multiplies_assign) // *= + BOOST_YAP_USING_OPERATOR_FN(divides_assign) // /= + BOOST_YAP_USING_OPERATOR_FN(modulus_assign) // %= + BOOST_YAP_USING_OPERATOR_FN(plus_assign) // += + BOOST_YAP_USING_OPERATOR_FN(minus_assign) // -= + BOOST_YAP_USING_OPERATOR_FN(bitwise_and_assign) // &= + BOOST_YAP_USING_OPERATOR_FN(bitwise_or_assign) // |= + BOOST_YAP_USING_OPERATOR_FN(bitwise_xor_assign) // ^= + BOOST_YAP_USING_OPERATOR_FN(subscript) // [] + BOOST_YAP_USING_OPERATOR_FN(if_else) // (analogous to) ?: + BOOST_YAP_USING_OPERATOR_FN(call) // () -#undef BOOST_PROTO17_USING_OPERATOR_FN +#undef BOOST_YAP_USING_OPERATOR_FN inline namespace function_objects { -#define BOOST_PROTO17_DECLARE_OPERATOR_FN(op_name) \ +#define BOOST_YAP_DECLARE_OPERATOR_FN(op_name) \ inline constexpr eval_ ## op_name ## _fn eval_ ## op_name{}; - BOOST_PROTO17_DECLARE_OPERATOR_FN(unary_plus) // + - BOOST_PROTO17_DECLARE_OPERATOR_FN(negate) // - - BOOST_PROTO17_DECLARE_OPERATOR_FN(dereference) // * - BOOST_PROTO17_DECLARE_OPERATOR_FN(complement) // ~ - BOOST_PROTO17_DECLARE_OPERATOR_FN(address_of) // & - BOOST_PROTO17_DECLARE_OPERATOR_FN(logical_not) // ! - BOOST_PROTO17_DECLARE_OPERATOR_FN(pre_inc) // ++ - BOOST_PROTO17_DECLARE_OPERATOR_FN(pre_dec) // -- - BOOST_PROTO17_DECLARE_OPERATOR_FN(post_inc) // ++(int) - BOOST_PROTO17_DECLARE_OPERATOR_FN(post_dec) // --(int) - BOOST_PROTO17_DECLARE_OPERATOR_FN(shift_left) // << - BOOST_PROTO17_DECLARE_OPERATOR_FN(shift_right) // >> - BOOST_PROTO17_DECLARE_OPERATOR_FN(multiplies) // * - BOOST_PROTO17_DECLARE_OPERATOR_FN(divides) // / - BOOST_PROTO17_DECLARE_OPERATOR_FN(modulus) // % - BOOST_PROTO17_DECLARE_OPERATOR_FN(plus) // + - BOOST_PROTO17_DECLARE_OPERATOR_FN(minus) // - - BOOST_PROTO17_DECLARE_OPERATOR_FN(less) // < - BOOST_PROTO17_DECLARE_OPERATOR_FN(greater) // > - BOOST_PROTO17_DECLARE_OPERATOR_FN(less_equal) // <= - BOOST_PROTO17_DECLARE_OPERATOR_FN(greater_equal) // >= - BOOST_PROTO17_DECLARE_OPERATOR_FN(equal_to) // == - BOOST_PROTO17_DECLARE_OPERATOR_FN(not_equal_to) // != - BOOST_PROTO17_DECLARE_OPERATOR_FN(logical_or) // || - BOOST_PROTO17_DECLARE_OPERATOR_FN(logical_and) // && - BOOST_PROTO17_DECLARE_OPERATOR_FN(bitwise_and) // & - BOOST_PROTO17_DECLARE_OPERATOR_FN(bitwise_or) // | - BOOST_PROTO17_DECLARE_OPERATOR_FN(bitwise_xor) // ^ - BOOST_PROTO17_DECLARE_OPERATOR_FN(comma) // , - BOOST_PROTO17_DECLARE_OPERATOR_FN(mem_ptr) // ->* - BOOST_PROTO17_DECLARE_OPERATOR_FN(assign) // = - BOOST_PROTO17_DECLARE_OPERATOR_FN(shift_left_assign) // <<= - BOOST_PROTO17_DECLARE_OPERATOR_FN(shift_right_assign) // >>= - BOOST_PROTO17_DECLARE_OPERATOR_FN(multiplies_assign) // *= - BOOST_PROTO17_DECLARE_OPERATOR_FN(divides_assign) // /= - BOOST_PROTO17_DECLARE_OPERATOR_FN(modulus_assign) // %= - BOOST_PROTO17_DECLARE_OPERATOR_FN(plus_assign) // += - BOOST_PROTO17_DECLARE_OPERATOR_FN(minus_assign) // -= - BOOST_PROTO17_DECLARE_OPERATOR_FN(bitwise_and_assign) // &= - BOOST_PROTO17_DECLARE_OPERATOR_FN(bitwise_or_assign) // |= - BOOST_PROTO17_DECLARE_OPERATOR_FN(bitwise_xor_assign) // ^= - BOOST_PROTO17_DECLARE_OPERATOR_FN(subscript) // [] - BOOST_PROTO17_DECLARE_OPERATOR_FN(if_else) // (analogous to) ?: - BOOST_PROTO17_DECLARE_OPERATOR_FN(call) // () + BOOST_YAP_DECLARE_OPERATOR_FN(unary_plus) // + + BOOST_YAP_DECLARE_OPERATOR_FN(negate) // - + BOOST_YAP_DECLARE_OPERATOR_FN(dereference) // * + BOOST_YAP_DECLARE_OPERATOR_FN(complement) // ~ + BOOST_YAP_DECLARE_OPERATOR_FN(address_of) // & + BOOST_YAP_DECLARE_OPERATOR_FN(logical_not) // ! + BOOST_YAP_DECLARE_OPERATOR_FN(pre_inc) // ++ + BOOST_YAP_DECLARE_OPERATOR_FN(pre_dec) // -- + BOOST_YAP_DECLARE_OPERATOR_FN(post_inc) // ++(int) + BOOST_YAP_DECLARE_OPERATOR_FN(post_dec) // --(int) + BOOST_YAP_DECLARE_OPERATOR_FN(shift_left) // << + BOOST_YAP_DECLARE_OPERATOR_FN(shift_right) // >> + BOOST_YAP_DECLARE_OPERATOR_FN(multiplies) // * + BOOST_YAP_DECLARE_OPERATOR_FN(divides) // / + BOOST_YAP_DECLARE_OPERATOR_FN(modulus) // % + BOOST_YAP_DECLARE_OPERATOR_FN(plus) // + + BOOST_YAP_DECLARE_OPERATOR_FN(minus) // - + BOOST_YAP_DECLARE_OPERATOR_FN(less) // < + BOOST_YAP_DECLARE_OPERATOR_FN(greater) // > + BOOST_YAP_DECLARE_OPERATOR_FN(less_equal) // <= + BOOST_YAP_DECLARE_OPERATOR_FN(greater_equal) // >= + BOOST_YAP_DECLARE_OPERATOR_FN(equal_to) // == + BOOST_YAP_DECLARE_OPERATOR_FN(not_equal_to) // != + BOOST_YAP_DECLARE_OPERATOR_FN(logical_or) // || + BOOST_YAP_DECLARE_OPERATOR_FN(logical_and) // && + BOOST_YAP_DECLARE_OPERATOR_FN(bitwise_and) // & + BOOST_YAP_DECLARE_OPERATOR_FN(bitwise_or) // | + BOOST_YAP_DECLARE_OPERATOR_FN(bitwise_xor) // ^ + BOOST_YAP_DECLARE_OPERATOR_FN(comma) // , + BOOST_YAP_DECLARE_OPERATOR_FN(mem_ptr) // ->* + BOOST_YAP_DECLARE_OPERATOR_FN(assign) // = + BOOST_YAP_DECLARE_OPERATOR_FN(shift_left_assign) // <<= + BOOST_YAP_DECLARE_OPERATOR_FN(shift_right_assign) // >>= + BOOST_YAP_DECLARE_OPERATOR_FN(multiplies_assign) // *= + BOOST_YAP_DECLARE_OPERATOR_FN(divides_assign) // /= + BOOST_YAP_DECLARE_OPERATOR_FN(modulus_assign) // %= + BOOST_YAP_DECLARE_OPERATOR_FN(plus_assign) // += + BOOST_YAP_DECLARE_OPERATOR_FN(minus_assign) // -= + BOOST_YAP_DECLARE_OPERATOR_FN(bitwise_and_assign) // &= + BOOST_YAP_DECLARE_OPERATOR_FN(bitwise_or_assign) // |= + BOOST_YAP_DECLARE_OPERATOR_FN(bitwise_xor_assign) // ^= + BOOST_YAP_DECLARE_OPERATOR_FN(subscript) // [] + BOOST_YAP_DECLARE_OPERATOR_FN(if_else) // (analogous to) ?: + BOOST_YAP_DECLARE_OPERATOR_FN(call) // () -#undef BOOST_PROTO17_DECLARE_OPERATOR_FN +#undef BOOST_YAP_DECLARE_OPERATOR_FN } diff --git a/perf/code_gen_samples.cpp b/perf/code_gen_samples.cpp index 1e5e102..25347f7 100644 --- a/perf/code_gen_samples.cpp +++ b/perf/code_gen_samples.cpp @@ -1,11 +1,11 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -27,11 +27,11 @@ namespace user { template decltype(auto) transform_expression ( - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< Expr1, Expr2 diff --git a/print.hpp b/print.hpp index 7b78992..fa493c1 100644 --- a/print.hpp +++ b/print.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_PROTO17_PRINT_HPP_INCLUDED -#define BOOST_PROTO17_PRINT_HPP_INCLUDED +#ifndef BOOST_YAP_PRINT_HPP_INCLUDED +#define BOOST_YAP_PRINT_HPP_INCLUDED #include "expression_fwd.hpp" @@ -8,7 +8,7 @@ #include -namespace boost::proto17 { +namespace boost::yap { namespace detail { @@ -53,7 +53,7 @@ namespace boost::proto17 { if constexpr (Expr::kind == expr_kind::expr_ref) { print_impl( os, - ::boost::proto17::value(expr), + ::boost::yap::value(expr), indent, indent_str, true, @@ -68,7 +68,7 @@ namespace boost::proto17 { os << "term<"; print_type(os, expr.elements); os << ">[="; - print_value(os, ::boost::proto17::value(expr)); + print_value(os, ::boost::yap::value(expr)); os << "]"; if (is_const_ref) os << " const &"; @@ -76,7 +76,7 @@ namespace boost::proto17 { os << " &"; os << "\n"; } else if constexpr (Expr::kind == expr_kind::placeholder) { - os << "placeholder<" << (long long)::boost::proto17::value(expr) << ">"; + os << "placeholder<" << (long long)::boost::yap::value(expr) << ">"; if (is_const_ref) os << " const &"; else if (is_ref) diff --git a/test/call_expr.cpp b/test/call_expr.cpp index 8920d95..ad771ec 100644 --- a/test/call_expr.cpp +++ b/test/call_expr.cpp @@ -1,4 +1,4 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include @@ -7,9 +7,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -35,7 +35,7 @@ namespace user { struct eval_xform_tag { - decltype(auto) operator() (bp17::call_tag, tag_type, double a, double b) + decltype(auto) operator() (yap::call_tag, tag_type, double a, double b) { return tag_function(a, b); } }; @@ -44,10 +44,10 @@ namespace user { struct eval_xform_expr { decltype(auto) operator() ( - bp17::expression< - bp17::expr_kind::call, + yap::expression< + yap::expr_kind::call, bh::tuple< - bp17::expression_ref >, + yap::expression_ref >, term, term > @@ -55,32 +55,32 @@ namespace user { ) { using namespace boost::hana::literals; return tag_function( - (double)bp17::value(expr.elements[1_c]).value, - (double)bp17::value(expr.elements[2_c]) + (double)yap::value(expr.elements[1_c]).value, + (double)yap::value(expr.elements[2_c]) ); } decltype(auto) operator() ( - bp17::expression< - bp17::expr_kind::call, + yap::expression< + yap::expr_kind::call, bh::tuple< - bp17::expression_ref >, - bp17::expression_ref>, + yap::expression_ref >, + yap::expression_ref>, term > > const & expr ) { using namespace boost::hana::literals; return tag_function( - (double)bp17::deref(expr.elements[1_c]).value, - (double)bp17::value(expr.elements[2_c]) + (double)yap::deref(expr.elements[1_c]).value, + (double)yap::value(expr.elements[2_c]) ); } }; struct eval_xform_both { - decltype(auto) operator() (bp17::call_tag, tag_type, double a, double b) + decltype(auto) operator() (yap::call_tag, tag_type, double a, double b) { // TODO: Document that this differs from the behavior for // non-call_tag tagged overloads, which will always be preferred @@ -91,10 +91,10 @@ namespace user { } decltype(auto) operator() ( - bp17::expression< - bp17::expr_kind::call, + yap::expression< + yap::expr_kind::call, bh::tuple< - bp17::expression_ref >, + yap::expression_ref >, term, term > @@ -102,25 +102,25 @@ namespace user { ) { using namespace boost::hana::literals; return tag_function( - (double)bp17::value(expr.elements[1_c]).value, - (double)bp17::value(expr.elements[2_c]) + (double)yap::value(expr.elements[1_c]).value, + (double)yap::value(expr.elements[2_c]) ); } decltype(auto) operator() ( - bp17::expression< - bp17::expr_kind::call, + yap::expression< + yap::expr_kind::call, bh::tuple< - bp17::expression_ref >, - bp17::expression_ref>, + yap::expression_ref >, + yap::expression_ref>, term > > const & expr ) { using namespace boost::hana::literals; return tag_function( - (double)bp17::deref(expr.elements[1_c]).value, - (double)bp17::value(expr.elements[2_c]) + (double)yap::deref(expr.elements[1_c]).value, + (double)yap::value(expr.elements[2_c]) ); } }; @@ -141,15 +141,15 @@ namespace user { TEST(call_expr, test_call_expr) { - using namespace boost::proto17::literals; + using namespace boost::yap::literals; { - bp17::expression< - bp17::expr_kind::call, + yap::expression< + yap::expr_kind::call, bh::tuple< - bp17::placeholder<1>, - bp17::placeholder<2>, - bp17::placeholder<3> + yap::placeholder<1>, + yap::placeholder<2>, + yap::placeholder<3> > > expr = 1_p(2_p, 3_p); @@ -174,7 +174,7 @@ TEST(call_expr, test_call_expr) auto min_lambda = [] (int a, int b) { return a < b ? a : b; }; { - auto min = bp17::make_terminal(min_lambda); + auto min = yap::make_terminal(min_lambda); auto expr = min(1_p, 2_p); { @@ -203,7 +203,7 @@ TEST(call_expr, test_call_expr) min_function_object_t min_function_object; { - term min = bp17::make_terminal(min_function_object); + term min = yap::make_terminal(min_function_object); auto expr = min(1_p, 2_p); { @@ -224,7 +224,7 @@ TEST(call_expr, test_call_expr) } { - auto min = bp17::make_terminal(min_function_object_t{}); + auto min = yap::make_terminal(min_function_object_t{}); auto expr = min(1_p, 2_p); { @@ -249,7 +249,7 @@ TEST(call_expr, test_call_expr) auto min_lambda = [] (int a, int b) { return a < b ? a : b; }; { - auto min = bp17::make_terminal(min_lambda); + auto min = yap::make_terminal(min_lambda); auto expr = min(0, 1); { @@ -260,10 +260,10 @@ TEST(call_expr, test_call_expr) { term min = {{min_lambda}}; - bp17::expression< - bp17::expr_kind::call, + yap::expression< + yap::expr_kind::call, bh::tuple< - bp17::expression_ref& >, + yap::expression_ref& >, term, term > @@ -278,7 +278,7 @@ TEST(call_expr, test_call_expr) { { - auto plus = bp17::make_terminal(user::tag_type{}); + auto plus = yap::make_terminal(user::tag_type{}); auto expr = plus(user::number{13}, 1); { @@ -289,10 +289,10 @@ TEST(call_expr, test_call_expr) { term plus = {{user::tag_type{}}}; - bp17::expression< - bp17::expr_kind::call, + yap::expression< + yap::expr_kind::call, bh::tuple< - bp17::expression_ref& >, + yap::expression_ref& >, term, term > @@ -305,7 +305,7 @@ TEST(call_expr, test_call_expr) } { - auto plus = bp17::make_terminal(user::tag_type{}); + auto plus = yap::make_terminal(user::tag_type{}); auto expr = plus(user::number{13}, 1); { @@ -331,8 +331,8 @@ TEST(call_expr, test_call_expr) } { - auto plus = bp17::make_terminal(user::tag_type{}); - auto thirteen = bp17::make_terminal(user::number{13}); + auto plus = yap::make_terminal(user::tag_type{}); + auto thirteen = yap::make_terminal(user::number{13}); auto expr = plus(thirteen, 1); { @@ -356,7 +356,7 @@ TEST(call_expr, test_call_expr) term a{{1.0}}; term x{{42.0}}; term y{{3.0}}; - auto n = bp17::make_terminal(user::naxpy); + auto n = yap::make_terminal(user::naxpy); auto expr = n(a, x, y); { diff --git a/test/compile_const_term.cpp b/test/compile_const_term.cpp index 4ded011..4a7a85f 100644 --- a/test/compile_const_term.cpp +++ b/test/compile_const_term.cpp @@ -1,9 +1,9 @@ #include "expression.hpp" template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -13,21 +13,21 @@ void compile_const_term () term unity{1.0}; int i_ = 42; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > @@ -40,21 +40,21 @@ void compile_const_term () term const unity{1.0}; int i_ = 42; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref const &>, + yap::expression_ref const &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref const &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref const &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref const &>, + yap::expression_ref const &>, term > > @@ -67,21 +67,21 @@ void compile_const_term () term unity{1.0}; int i_ = 42; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > const expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > diff --git a/test/compile_copy_only_types.cpp b/test/compile_copy_only_types.cpp index c9d8ad7..bc155fe 100644 --- a/test/compile_copy_only_types.cpp +++ b/test/compile_copy_only_types.cpp @@ -3,9 +3,9 @@ #include template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; inline auto double_to_float (term expr) @@ -24,17 +24,17 @@ void compile_copy_only_types () #if 0 // TODO: This ICEs! term unity{1}; term d{3.5}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, term, term > expr_1 = unity + d; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, term, - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, term, term > diff --git a/test/compile_is_expr.cpp b/test/compile_is_expr.cpp index 4d3ba26..196e4f5 100644 --- a/test/compile_is_expr.cpp +++ b/test/compile_is_expr.cpp @@ -1,16 +1,16 @@ #include "expression.hpp" -namespace bp17 = boost::proto17; +namespace yap = boost::yap; struct alternate_expr_1 { - static const bp17::expr_kind kind = bp17::expr_kind::plus; + static const yap::expr_kind kind = yap::expr_kind::plus; boost::hana::tuple<> elements; }; struct alternate_expr_2 { - static const bp17::expr_kind kind = bp17::expr_kind::plus; + static const yap::expr_kind kind = yap::expr_kind::plus; boost::hana::tuple elements; }; @@ -38,50 +38,50 @@ struct non_expr_4 struct non_expr_5 { - static const bp17::expr_kind kind = bp17::expr_kind::plus; + static const yap::expr_kind kind = yap::expr_kind::plus; }; struct non_expr_6 { - static const bp17::expr_kind kind = bp17::expr_kind::plus; + static const yap::expr_kind kind = yap::expr_kind::plus; int elements; }; void compile_is_expr () { - static_assert(bp17::detail::is_hana_tuple>::value); - static_assert(bp17::detail::is_hana_tuple>::value); + static_assert(yap::detail::is_hana_tuple>::value); + static_assert(yap::detail::is_hana_tuple>::value); - static_assert(! bp17::detail::is_hana_tuple::value); + static_assert(! yap::detail::is_hana_tuple::value); static_assert( - bp17::detail::is_hana_tuple< - bp17::detail::remove_cv_ref_t< - decltype(std::declval>().elements) + yap::detail::is_hana_tuple< + yap::detail::remove_cv_ref_t< + decltype(std::declval>().elements) > >::value ); - static_assert(bp17::detail::is_expr>::value); + static_assert(yap::detail::is_expr>::value); - static_assert(bp17::detail::is_expr const>::value); - static_assert(bp17::detail::is_expr const &>::value); - static_assert(bp17::detail::is_expr &>::value); - static_assert(bp17::detail::is_expr &&>::value); + static_assert(yap::detail::is_expr const>::value); + static_assert(yap::detail::is_expr const &>::value); + static_assert(yap::detail::is_expr &>::value); + static_assert(yap::detail::is_expr &&>::value); - static_assert(bp17::detail::is_expr>::value); - static_assert(bp17::detail::is_expr>>>::value); - static_assert(bp17::detail::is_expr, bp17::terminal>>>::value); + static_assert(yap::detail::is_expr>::value); + static_assert(yap::detail::is_expr>>>::value); + static_assert(yap::detail::is_expr, yap::terminal>>>::value); - static_assert(bp17::detail::is_expr::value); - static_assert(bp17::detail::is_expr::value); + static_assert(yap::detail::is_expr::value); + static_assert(yap::detail::is_expr::value); - static_assert(! bp17::detail::is_expr::value); - static_assert(! bp17::detail::is_expr::value); - static_assert(! bp17::detail::is_expr::value); - static_assert(! bp17::detail::is_expr::value); - static_assert(! bp17::detail::is_expr::value); - static_assert(! bp17::detail::is_expr::value); - static_assert(! bp17::detail::is_expr::value); + static_assert(! yap::detail::is_expr::value); + static_assert(! yap::detail::is_expr::value); + static_assert(! yap::detail::is_expr::value); + static_assert(! yap::detail::is_expr::value); + static_assert(! yap::detail::is_expr::value); + static_assert(! yap::detail::is_expr::value); + static_assert(! yap::detail::is_expr::value); } diff --git a/test/compile_move_only_types.cpp b/test/compile_move_only_types.cpp index 51ac5ce..8527491 100644 --- a/test/compile_move_only_types.cpp +++ b/test/compile_move_only_types.cpp @@ -3,9 +3,9 @@ #include template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -16,22 +16,22 @@ void compile_move_only_types () { term unity{1.0}; term> i{new int{7}}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term> > > expr_1 = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term> > > diff --git a/test/compile_placeholders.cpp b/test/compile_placeholders.cpp index 03556fb..3405875 100644 --- a/test/compile_placeholders.cpp +++ b/test/compile_placeholders.cpp @@ -1,41 +1,41 @@ #include "expression.hpp" template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; void compile_placeholders () { - using namespace boost::proto17::literals; + using namespace boost::yap::literals; { - bp17::placeholder<1> p1 = 1_p; + yap::placeholder<1> p1 = 1_p; (void)p1; } { - bp17::placeholder<1> p1 = 1_p; + yap::placeholder<1> p1 = 1_p; term unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > expr = p1 + unity; (void)expr; } { - bp17::placeholder<1> p1 = 1_p; - bp17::expression< - bp17::expr_kind::plus, + yap::placeholder<1> p1 = 1_p; + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::placeholder<2> + yap::expression_ref &>, + yap::placeholder<2> > > expr = p1 + 2_p; (void)expr; diff --git a/test/compile_term_plus_expr.cpp b/test/compile_term_plus_expr.cpp index 90352ce..3e84946 100644 --- a/test/compile_term_plus_expr.cpp +++ b/test/compile_term_plus_expr.cpp @@ -1,9 +1,9 @@ #include "expression.hpp" template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -13,22 +13,22 @@ void compile_term_plus_expr () { term unity{1.0}; term i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > expr = unity + i; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &>, + yap::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > &> > @@ -39,22 +39,22 @@ void compile_term_plus_expr () { term unity{1.0}; term i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > expr = unity + i; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &>, + yap::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > &> > @@ -65,21 +65,21 @@ void compile_term_plus_expr () { term unity{1.0}; term i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &>, + yap::expression_ref &>, + yap::expression_ref &>, term > > &> @@ -92,22 +92,22 @@ void compile_term_plus_expr () { term unity{1.0}; term const i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref const &> + yap::expression_ref &>, + yap::expression_ref const &> > > const expr = unity + i; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &>, + yap::expression_ref &>, - bp17::expression_ref const &> + yap::expression_ref &>, + yap::expression_ref const &> > > const &> > @@ -118,22 +118,22 @@ void compile_term_plus_expr () { term unity{1.0}; term i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > const expr = unity + i; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &>, + yap::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > const &> > @@ -146,22 +146,22 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > expr = unity + i; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &>, + yap::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > &> > @@ -173,22 +173,22 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > expr = unity + i; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &>, + yap::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > &> > @@ -200,21 +200,21 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &>, + yap::expression_ref &>, + yap::expression_ref &>, term > > &> @@ -227,22 +227,22 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > expr = unity + i; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > > @@ -254,22 +254,22 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > expr = unity + i; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > > @@ -281,21 +281,21 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > @@ -309,21 +309,21 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > @@ -336,21 +336,21 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > @@ -363,21 +363,21 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > @@ -390,21 +390,21 @@ void compile_term_plus_expr () term unity{1.0}; int i_ = 1; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > diff --git a/test/compile_term_plus_term.cpp b/test/compile_term_plus_term.cpp index 3d44c81..8150280 100644 --- a/test/compile_term_plus_term.cpp +++ b/test/compile_term_plus_term.cpp @@ -4,9 +4,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -17,10 +17,10 @@ void compile_term_plus_term () // char const * string { term unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + term{"3"}; @@ -30,10 +30,10 @@ void compile_term_plus_term () // std::string temporary { term unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + term{"3"s}; @@ -45,11 +45,11 @@ void compile_term_plus_term () term unity{1.0}; int ints_[] = {1, 2}; term ints = {ints_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > unevaluated_expr = unity + ints; (void)unevaluated_expr; @@ -59,11 +59,11 @@ void compile_term_plus_term () term unity{1.0}; int const ints_[] = {1, 2}; term ints = {ints_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > unevaluated_expr = unity + ints; (void)unevaluated_expr; @@ -73,10 +73,10 @@ void compile_term_plus_term () term unity{1.0}; int ints_[] = {1, 2}; term ints = {ints_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(ints); @@ -88,11 +88,11 @@ void compile_term_plus_term () term unity{1.0}; int ints[] = {1, 2}; term int_ptr = {ints}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > unevaluated_expr = unity + int_ptr; (void)unevaluated_expr; @@ -102,11 +102,11 @@ void compile_term_plus_term () term unity{1.0}; int const ints[] = {1, 2}; term int_ptr = {ints}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > unevaluated_expr = unity + int_ptr; (void)unevaluated_expr; @@ -116,10 +116,10 @@ void compile_term_plus_term () term unity{1.0}; int ints[] = {1, 2}; term int_ptr = {ints}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(int_ptr); @@ -130,11 +130,11 @@ void compile_term_plus_term () { term unity{1.0}; term i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > unevaluated_expr = unity + i; (void)unevaluated_expr; @@ -143,11 +143,11 @@ void compile_term_plus_term () { term unity{1.0}; term i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > unevaluated_expr = unity + i; (void)unevaluated_expr; @@ -156,10 +156,10 @@ void compile_term_plus_term () { term unity{1.0}; term i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(i); @@ -170,11 +170,11 @@ void compile_term_plus_term () { term unity{1.0}; term const i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref const &> + yap::expression_ref &>, + yap::expression_ref const &> > > unevaluated_expr = unity + i; (void)unevaluated_expr; @@ -183,11 +183,11 @@ void compile_term_plus_term () { term unity{1.0}; term const i = {1}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref const &> + yap::expression_ref &>, + yap::expression_ref const &> > > unevaluated_expr = unity + i; (void)unevaluated_expr; @@ -198,11 +198,11 @@ void compile_term_plus_term () term unity{1.0}; int i_ = 1; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > unevaluated_expr = unity + i; (void)unevaluated_expr; @@ -212,11 +212,11 @@ void compile_term_plus_term () term unity{1.0}; int i_ = 1; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > > unevaluated_expr = unity + i; (void)unevaluated_expr; @@ -226,10 +226,10 @@ void compile_term_plus_term () term unity{1.0}; int i_ = 1; term i{i_}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(i); @@ -241,10 +241,10 @@ void compile_term_plus_term () term unity{1.0}; int i_ = 1; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(i); @@ -255,10 +255,10 @@ void compile_term_plus_term () term unity{1.0}; int i_ = 1; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(i); diff --git a/test/compile_term_plus_x.cpp b/test/compile_term_plus_x.cpp index 754ea3c..0ee2b7c 100644 --- a/test/compile_term_plus_x.cpp +++ b/test/compile_term_plus_x.cpp @@ -4,9 +4,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -17,10 +17,10 @@ void compile_term_plus_x () // char const * string { term unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + "3"; @@ -30,10 +30,10 @@ void compile_term_plus_x () // std::string temporary { term unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + "3"s; @@ -44,10 +44,10 @@ void compile_term_plus_x () { term unity{1.0}; int ints[] = {1, 2}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + ints; @@ -57,10 +57,10 @@ void compile_term_plus_x () { term unity{1.0}; int const ints[] = {1, 2}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + ints; @@ -70,10 +70,10 @@ void compile_term_plus_x () { term unity{1.0}; int ints[] = {1, 2}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(ints); @@ -85,10 +85,10 @@ void compile_term_plus_x () term unity{1.0}; int ints[] = {1, 2}; int * int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + int_ptr; @@ -99,10 +99,10 @@ void compile_term_plus_x () term unity{1.0}; int const ints[] = {1, 2}; int const * int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + int_ptr; @@ -113,10 +113,10 @@ void compile_term_plus_x () term unity{1.0}; int ints[] = {1, 2}; int * int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(int_ptr); @@ -128,10 +128,10 @@ void compile_term_plus_x () term unity{1.0}; int ints[] = {1, 2}; int * const int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + int_ptr; @@ -142,10 +142,10 @@ void compile_term_plus_x () term unity{1.0}; int const ints[] = {1, 2}; int const * const int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + int_ptr; @@ -156,10 +156,10 @@ void compile_term_plus_x () term unity{1.0}; int ints[] = {1, 2}; int * const int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(int_ptr); @@ -170,10 +170,10 @@ void compile_term_plus_x () { term unity{1.0}; int i = 1; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + i; @@ -183,10 +183,10 @@ void compile_term_plus_x () { term unity{1.0}; int const i = 1; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + i; @@ -196,10 +196,10 @@ void compile_term_plus_x () { term unity{1.0}; int i = 1; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(i); diff --git a/test/compile_term_plus_x_this_ref_overloads.cpp b/test/compile_term_plus_x_this_ref_overloads.cpp index 7fdcc4e..359bc96 100644 --- a/test/compile_term_plus_x_this_ref_overloads.cpp +++ b/test/compile_term_plus_x_this_ref_overloads.cpp @@ -4,9 +4,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -17,10 +17,10 @@ void compile_term_plus_x_this_ref_overloads () // char const * string { term unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + "3"; @@ -30,10 +30,10 @@ void compile_term_plus_x_this_ref_overloads () // std::string temporary { term unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + "3"s; @@ -44,10 +44,10 @@ void compile_term_plus_x_this_ref_overloads () { term unity{1.0}; int ints[] = {1, 2}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + ints; @@ -57,10 +57,10 @@ void compile_term_plus_x_this_ref_overloads () { term unity{1.0}; int const ints[] = {1, 2}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + ints; @@ -70,10 +70,10 @@ void compile_term_plus_x_this_ref_overloads () { term unity{1.0}; int ints[] = {1, 2}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(ints); @@ -85,10 +85,10 @@ void compile_term_plus_x_this_ref_overloads () term unity{1.0}; int ints[] = {1, 2}; int * int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + int_ptr; @@ -99,10 +99,10 @@ void compile_term_plus_x_this_ref_overloads () term unity{1.0}; int const ints[] = {1, 2}; int const * int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + int_ptr; @@ -113,10 +113,10 @@ void compile_term_plus_x_this_ref_overloads () term unity{1.0}; int ints[] = {1, 2}; int * int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(int_ptr); @@ -128,10 +128,10 @@ void compile_term_plus_x_this_ref_overloads () term unity{1.0}; int ints[] = {1, 2}; int * const int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + int_ptr; @@ -142,10 +142,10 @@ void compile_term_plus_x_this_ref_overloads () term unity{1.0}; int const ints[] = {1, 2}; int const * const int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + int_ptr; @@ -156,10 +156,10 @@ void compile_term_plus_x_this_ref_overloads () term unity{1.0}; int ints[] = {1, 2}; int * const int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(int_ptr); @@ -170,10 +170,10 @@ void compile_term_plus_x_this_ref_overloads () { term unity{1.0}; int i = 1; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + i; @@ -183,10 +183,10 @@ void compile_term_plus_x_this_ref_overloads () { term unity{1.0}; int const i = 1; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + i; @@ -196,10 +196,10 @@ void compile_term_plus_x_this_ref_overloads () { term unity{1.0}; int i = 1; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > unevaluated_expr = unity + std::move(i); diff --git a/test/compile_x_plus_term.cpp b/test/compile_x_plus_term.cpp index dd5f045..4e8ac5e 100644 --- a/test/compile_x_plus_term.cpp +++ b/test/compile_x_plus_term.cpp @@ -4,9 +4,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -17,11 +17,11 @@ void compile_x_plus_term () // char const * string { term unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = "3" + unity; (void)unevaluated_expr; @@ -30,11 +30,11 @@ void compile_x_plus_term () // std::string temporary { term const unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref const &> + yap::expression_ref const &> > > unevaluated_expr = "3"s + unity; (void)unevaluated_expr; @@ -44,11 +44,11 @@ void compile_x_plus_term () { term unity{1.0}; int ints[] = {1, 2}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = ints + unity; (void)unevaluated_expr; @@ -57,11 +57,11 @@ void compile_x_plus_term () { term unity{1.0}; int const ints[] = {1, 2}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = ints + unity; (void)unevaluated_expr; @@ -70,11 +70,11 @@ void compile_x_plus_term () { term unity{1.0}; int ints[] = {1, 2}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = std::move(ints) + unity; (void)unevaluated_expr; @@ -85,11 +85,11 @@ void compile_x_plus_term () term unity{1.0}; int ints[] = {1, 2}; int * int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = int_ptr + unity; (void)unevaluated_expr; @@ -99,11 +99,11 @@ void compile_x_plus_term () term unity{1.0}; int const ints[] = {1, 2}; int const * int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = int_ptr + unity; (void)unevaluated_expr; @@ -113,11 +113,11 @@ void compile_x_plus_term () term unity{1.0}; int ints[] = {1, 2}; int * int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = std::move(int_ptr) + unity; (void)unevaluated_expr; @@ -128,11 +128,11 @@ void compile_x_plus_term () term unity{1.0}; int ints[] = {1, 2}; int * const int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = int_ptr + unity; (void)unevaluated_expr; @@ -142,11 +142,11 @@ void compile_x_plus_term () term unity{1.0}; int const ints[] = {1, 2}; int const * const int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = int_ptr + unity; (void)unevaluated_expr; @@ -156,11 +156,11 @@ void compile_x_plus_term () term unity{1.0}; int ints[] = {1, 2}; int * const int_ptr = ints; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = std::move(int_ptr) + unity; (void)unevaluated_expr; @@ -170,11 +170,11 @@ void compile_x_plus_term () { term unity{1.0}; int i = 1; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = i + unity; (void)unevaluated_expr; @@ -183,11 +183,11 @@ void compile_x_plus_term () { term unity{1.0}; int const i = 1; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = i + unity; (void)unevaluated_expr; @@ -196,11 +196,11 @@ void compile_x_plus_term () { term unity{1.0}; int i = 1; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< term, - bp17::expression_ref &> + yap::expression_ref &> > > unevaluated_expr = std::move(i) + unity; (void)unevaluated_expr; diff --git a/test/default_eval.cpp b/test/default_eval.cpp index 0c02e5b..cf148cf 100644 --- a/test/default_eval.cpp +++ b/test/default_eval.cpp @@ -1,13 +1,13 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -16,41 +16,41 @@ TEST(default_eval, default_eval) term unity{1.0}; int i_ = 42; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::minus, + yap::expression< + yap::expr_kind::minus, bh::tuple< - boost::proto17::expression_ref &>, + boost::yap::expression_ref &>, term > > expr = unity - std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - boost::proto17::expression_ref &>, - bp17::expression< - bp17::expr_kind::minus, + boost::yap::expression_ref &>, + yap::expression< + yap::expr_kind::minus, bh::tuple< - boost::proto17::expression_ref &>, + boost::yap::expression_ref &>, term > > > > unevaluated_expr_1 = unity + std::move(expr); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - boost::proto17::expression_ref &>, - boost::proto17::expression_ref &> + boost::yap::expression_ref &>, + boost::yap::expression_ref &> > > unevaluated_expr_2 = unity + unity; term const const_unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - boost::proto17::expression_ref &>, - boost::proto17::expression_ref const &> + boost::yap::expression_ref &>, + boost::yap::expression_ref const &> > > unevaluated_expr_3 = unity + const_unity; diff --git a/test/depth_stress_test_left.cpp b/test/depth_stress_test_left.cpp index 16aebc8..9c4ef59 100644 --- a/test/depth_stress_test_left.cpp +++ b/test/depth_stress_test_left.cpp @@ -1,4 +1,4 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include @@ -7,9 +7,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; TEST(left, depth_stress_test) diff --git a/test/depth_stress_test_right.cpp b/test/depth_stress_test_right.cpp index 138f2e3..2e7ca79 100644 --- a/test/depth_stress_test_right.cpp +++ b/test/depth_stress_test_right.cpp @@ -1,4 +1,4 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include @@ -7,9 +7,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; TEST(right, depth_stress_test) diff --git a/test/deref.cpp b/test/deref.cpp index e5c97f8..d295d5f 100644 --- a/test/deref.cpp +++ b/test/deref.cpp @@ -4,133 +4,133 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; -template +template struct user_expr { using this_type = user_expr; - static boost::proto17::expr_kind const kind = Kind; + static boost::yap::expr_kind const kind = Kind; Tuple elements; - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) }; template -using user_term = boost::proto17::terminal; +using user_term = boost::yap::terminal; template -using user_ref = boost::proto17::expression_ref; +using user_ref = boost::yap::expression_ref; TEST(builtin, test_deref) { { - EXPECT_TRUE((std::is_same::value)); - EXPECT_EQ(bp17::deref(1.0), 1.0); + EXPECT_TRUE((std::is_same::value)); + EXPECT_EQ(yap::deref(1.0), 1.0); } { double d = 2.0; - EXPECT_TRUE((std::is_same::value)); - EXPECT_EQ(bp17::deref(d), 2.0); + EXPECT_TRUE((std::is_same::value)); + EXPECT_EQ(yap::deref(d), 2.0); } { double const d = 3.0; - EXPECT_TRUE((std::is_same::value)); - EXPECT_EQ(bp17::deref(d), 3.0); + EXPECT_TRUE((std::is_same::value)); + EXPECT_EQ(yap::deref(d), 3.0); } } TEST(expression, test_deref) { { - EXPECT_TRUE((std::is_same{{1.0}})), term &&>::value)); - EXPECT_EQ(bh::front(bp17::deref(term{{1.0}}).elements), 1.0); + EXPECT_TRUE((std::is_same{{1.0}})), term &&>::value)); + EXPECT_EQ(bh::front(yap::deref(term{{1.0}}).elements), 1.0); } { term td = {{2.0}}; - EXPECT_TRUE((std::is_same &>::value)); - EXPECT_EQ(bh::front(bp17::deref(td).elements), 2.0); + EXPECT_TRUE((std::is_same &>::value)); + EXPECT_EQ(bh::front(yap::deref(td).elements), 2.0); } { term const td = {{3.0}}; - EXPECT_TRUE((std::is_same const &>::value)); - EXPECT_EQ(bh::front(bp17::deref(td).elements), 3.0); + EXPECT_TRUE((std::is_same const &>::value)); + EXPECT_EQ(bh::front(yap::deref(td).elements), 3.0); } term unity = {{1.0}}; - using plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > >; { - EXPECT_TRUE((std::is_same{{1}})), plus_expr_type &&>::value)); + EXPECT_TRUE((std::is_same{{1}})), plus_expr_type &&>::value)); } { plus_expr_type plus_expr = unity + term{{1}}; - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } { plus_expr_type const plus_expr = unity + term{{1}}; - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } plus_expr_type plus_expr = unity + term{{1}}; { - bp17::expression_ref &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + yap::expression_ref &> ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same::value)); } { - bp17::expression_ref &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + yap::expression_ref &> ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same::value)); } { - bp17::expression_ref &> const ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + yap::expression_ref &> const ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same::value)); } { term const unity = {{1.0}}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref const &>, + yap::expression_ref const &>, term > > plus_expr = unity + term{{1}}; { - bp17::expression_ref const &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + yap::expression_ref const &> ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same::value)); } { - bp17::expression_ref const &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + yap::expression_ref const &> ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same::value)); } { - bp17::expression_ref const &> const ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + yap::expression_ref const &> const ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same::value)); } } } @@ -138,25 +138,25 @@ TEST(expression, test_deref) TEST(user_expr, test_deref) { { - EXPECT_TRUE((std::is_same{{1.0}})), user_term &&>::value)); - EXPECT_EQ(bh::front(bp17::deref(user_term{{1.0}}).elements), 1.0); + EXPECT_TRUE((std::is_same{{1.0}})), user_term &&>::value)); + EXPECT_EQ(bh::front(yap::deref(user_term{{1.0}}).elements), 1.0); } { user_term td = {{2.0}}; - EXPECT_TRUE((std::is_same &>::value)); - EXPECT_EQ(bh::front(bp17::deref(td).elements), 2.0); + EXPECT_TRUE((std::is_same &>::value)); + EXPECT_EQ(bh::front(yap::deref(td).elements), 2.0); } { user_term const td = {{3.0}}; - EXPECT_TRUE((std::is_same const &>::value)); - EXPECT_EQ(bh::front(bp17::deref(td).elements), 3.0); + EXPECT_TRUE((std::is_same const &>::value)); + EXPECT_EQ(bh::front(yap::deref(td).elements), 3.0); } user_term unity = {{1.0}}; using plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term @@ -164,40 +164,40 @@ TEST(user_expr, test_deref) >; { - EXPECT_TRUE((std::is_same{{1}})), plus_expr_type &&>::value)); + EXPECT_TRUE((std::is_same{{1}})), plus_expr_type &&>::value)); } { plus_expr_type plus_expr = unity + user_term{{1}}; - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } { plus_expr_type const plus_expr = unity + user_term{{1}}; - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } plus_expr_type plus_expr = unity + user_term{{1}}; { user_ref &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } { user_ref &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } { user_ref &> const ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } { user_term const unity = {{1.0}}; user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref const &>, user_term @@ -206,17 +206,17 @@ TEST(user_expr, test_deref) { user_ref const &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } { user_ref const &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } { user_ref const &> const ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same::value)); + EXPECT_TRUE((std::is_same::value)); } } } diff --git a/test/left.cpp b/test/left.cpp index 883b610..f2810cd 100644 --- a/test/left.cpp +++ b/test/left.cpp @@ -4,38 +4,38 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; -template +template struct user_expr { using this_type = user_expr; - static boost::proto17::expr_kind const kind = Kind; + static boost::yap::expr_kind const kind = Kind; Tuple elements; - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) }; template -using user_term = boost::proto17::terminal; +using user_term = boost::yap::terminal; template -using user_ref = boost::proto17::expression_ref; +using user_ref = boost::yap::expression_ref; TEST(expression, test_left) { term unity = {{1.0}}; - using plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > >; @@ -43,33 +43,33 @@ TEST(expression, test_left) { plus_expr_type plus_expr = unity + term{{1}}; EXPECT_TRUE(( - std::is_same &> &&>::value + std::is_same &> &&>::value )); } { plus_expr_type plus_expr = unity + term{{1}}; EXPECT_TRUE(( - std::is_same &> &>::value + std::is_same &> &>::value )); } { plus_expr_type const plus_expr = unity + term{{1}}; EXPECT_TRUE(( - std::is_same &> const &>::value + std::is_same &> const &>::value )); } { term const unity = {{1.0}}; - using plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref const &>, + yap::expression_ref const &>, term > >; @@ -77,120 +77,120 @@ TEST(expression, test_left) { plus_expr_type plus_expr = unity + term{{1}}; EXPECT_TRUE(( - std::is_same const &> &&>::value + std::is_same const &> &&>::value )); } { plus_expr_type plus_expr = unity + term{{1}}; EXPECT_TRUE(( - std::is_same const &> &>::value + std::is_same const &> &>::value )); } { plus_expr_type const plus_expr = unity + term{{1}}; EXPECT_TRUE(( - std::is_same const &> const &>::value + std::is_same const &> const &>::value )); } } { term unity = {{1.0}}; - using plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > >; plus_expr_type plus_expr = unity + term{{1}}; - using plus_plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref, + yap::expression_ref, term > >; { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> &>::value + std::is_same &> &>::value )); } { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> &>::value + std::is_same &> &>::value )); } { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> &>::value + std::is_same &> &>::value )); } } { term unity = {{1.0}}; - using plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > >; plus_expr_type const plus_expr = unity + term{{1}}; - using plus_plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref, + yap::expression_ref, term > >; { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> const &>::value + std::is_same &> const &>::value )); } { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> const &>::value + std::is_same &> const &>::value )); } { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> const &>::value + std::is_same &> const &>::value )); } } @@ -200,7 +200,7 @@ TEST(user_expr, test_left) { user_term unity = {{1.0}}; using plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term @@ -210,7 +210,7 @@ TEST(user_expr, test_left) { plus_expr_type plus_expr = unity + user_term{{1}}; EXPECT_TRUE(( - std::is_same &> &&>::value )); } @@ -218,7 +218,7 @@ TEST(user_expr, test_left) { plus_expr_type plus_expr = unity + user_term{{1}}; EXPECT_TRUE(( - std::is_same &> &>::value )); } @@ -226,7 +226,7 @@ TEST(user_expr, test_left) { plus_expr_type const plus_expr = unity + user_term{{1}}; EXPECT_TRUE(( - std::is_same &> const &>::value )); } @@ -234,7 +234,7 @@ TEST(user_expr, test_left) { user_term const unity = {{1.0}}; using plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref const &>, user_term @@ -244,7 +244,7 @@ TEST(user_expr, test_left) { plus_expr_type plus_expr = unity + user_term{{1}}; EXPECT_TRUE(( - std::is_same const &> &&>::value )); } @@ -252,7 +252,7 @@ TEST(user_expr, test_left) { plus_expr_type plus_expr = unity + user_term{{1}}; EXPECT_TRUE(( - std::is_same const &> &>::value )); } @@ -260,7 +260,7 @@ TEST(user_expr, test_left) { plus_expr_type const plus_expr = unity + user_term{{1}}; EXPECT_TRUE(( - std::is_same const &> const &>::value )); } @@ -269,7 +269,7 @@ TEST(user_expr, test_left) { user_term unity = {{1.0}}; using plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term @@ -278,7 +278,7 @@ TEST(user_expr, test_left) plus_expr_type plus_expr = unity + user_term{{1}}; using plus_plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref, user_term @@ -289,7 +289,7 @@ TEST(user_expr, test_left) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> &>::value )); @@ -299,7 +299,7 @@ TEST(user_expr, test_left) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> &>::value )); } @@ -308,7 +308,7 @@ TEST(user_expr, test_left) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> &>::value )); } @@ -317,7 +317,7 @@ TEST(user_expr, test_left) { user_term unity = {{1.0}}; using plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term @@ -326,7 +326,7 @@ TEST(user_expr, test_left) plus_expr_type const plus_expr = unity + user_term{{1}}; using plus_plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref, user_term @@ -337,7 +337,7 @@ TEST(user_expr, test_left) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> const &>::value )); @@ -347,7 +347,7 @@ TEST(user_expr, test_left) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> const &>::value )); } @@ -356,7 +356,7 @@ TEST(user_expr, test_left) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &> const &>::value )); } diff --git a/test/placeholder_eval.cpp b/test/placeholder_eval.cpp index 0147524..11e48f7 100644 --- a/test/placeholder_eval.cpp +++ b/test/placeholder_eval.cpp @@ -6,34 +6,34 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; TEST(placeholder_eval, test_placeholder_eval) { - using namespace boost::proto17::literals; + using namespace boost::yap::literals; - bp17::placeholder<3> p3 = 3_p; + yap::placeholder<3> p3 = 3_p; int i_ = 42; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = p3 + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > diff --git a/test/print.cpp b/test/print.cpp index e88060c..6dcbf9d 100644 --- a/test/print.cpp +++ b/test/print.cpp @@ -7,29 +7,29 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; -template +template struct user_expr { using this_type = user_expr; - static boost::proto17::expr_kind const kind = Kind; + static boost::yap::expr_kind const kind = Kind; Tuple elements; - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) }; template -using user_term = boost::proto17::terminal; +using user_term = boost::yap::terminal; template -using user_ref = boost::proto17::expression_ref; +using user_ref = boost::yap::expression_ref; struct thing {}; @@ -38,21 +38,21 @@ TEST(expression, test_print) term unity{1.0}; int i_ = 42; term i{std::move(i_)}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > > @@ -61,14 +61,14 @@ TEST(expression, test_print) { std::ostringstream oss; - bp17::print(oss, unity); + yap::print(oss, unity); EXPECT_EQ(oss.str(), R"(term[=1] )"); } { std::ostringstream oss; - bp17::print(oss, expr); + yap::print(oss, expr); EXPECT_EQ(oss.str(), R"(expr<+> term[=1] & term[=42] @@ -77,7 +77,7 @@ TEST(expression, test_print) { std::ostringstream oss; - bp17::print(oss, unevaluated_expr); + yap::print(oss, unevaluated_expr); EXPECT_EQ(oss.str(), R"(expr<+> term[=1] & expr<+> @@ -90,23 +90,23 @@ TEST(expression, test_print) { std::ostringstream oss; - bp17::print(oss, a_thing); + yap::print(oss, a_thing); EXPECT_EQ(oss.str(), R"(term[=<>] )"); } term const const_unity{1.0}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref const &> + yap::expression_ref &>, + yap::expression_ref const &> > > nonconst_plus_const = unity + const_unity; { std::ostringstream oss; - bp17::print(oss, nonconst_plus_const); + yap::print(oss, nonconst_plus_const); EXPECT_EQ(oss.str(), R"(expr<+> term[=1] & term[=1] const & @@ -120,18 +120,18 @@ TEST(user_expr, test_print) int i_ = 42; user_term i{std::move(i_)}; user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term > > expr = unity + std::move(i); user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term @@ -142,14 +142,14 @@ TEST(user_expr, test_print) { std::ostringstream oss; - bp17::print(oss, unity); + yap::print(oss, unity); EXPECT_EQ(oss.str(), R"(term[=1] )"); } { std::ostringstream oss; - bp17::print(oss, expr); + yap::print(oss, expr); EXPECT_EQ(oss.str(), R"(expr<+> term[=1] & term[=42] @@ -158,7 +158,7 @@ TEST(user_expr, test_print) { std::ostringstream oss; - bp17::print(oss, unevaluated_expr); + yap::print(oss, unevaluated_expr); EXPECT_EQ(oss.str(), R"(expr<+> term[=1] & expr<+> @@ -171,14 +171,14 @@ TEST(user_expr, test_print) { std::ostringstream oss; - bp17::print(oss, a_thing); + yap::print(oss, a_thing); EXPECT_EQ(oss.str(), R"(term[=<>] )"); } user_term const const_unity{1.0}; user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_ref const &> @@ -187,7 +187,7 @@ TEST(user_expr, test_print) { std::ostringstream oss; - bp17::print(oss, nonconst_plus_const); + yap::print(oss, nonconst_plus_const); EXPECT_EQ(oss.str(), R"(expr<+> term[=1] & term[=1] const & diff --git a/test/reference_returns.cpp b/test/reference_returns.cpp index 4655b85..8f9052a 100644 --- a/test/reference_returns.cpp +++ b/test/reference_returns.cpp @@ -1,13 +1,13 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace reference_returning { @@ -69,7 +69,7 @@ TEST(reference_returns, test_reference_returns) > ); - using namespace bp17::literals; + using namespace yap::literals; { reference_returning::number & n = evaluate(1_p, reference_returning::a_result); diff --git a/test/right.cpp b/test/right.cpp index 2c2d3bc..c881881 100644 --- a/test/right.cpp +++ b/test/right.cpp @@ -4,38 +4,38 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; -template +template struct user_expr { using this_type = user_expr; - static boost::proto17::expr_kind const kind = Kind; + static boost::yap::expr_kind const kind = Kind; Tuple elements; - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) }; template -using user_term = boost::proto17::terminal; +using user_term = boost::yap::terminal; template -using user_ref = boost::proto17::expression_ref; +using user_ref = boost::yap::expression_ref; TEST(expression, test_right) { term unity = {{1.0}}; - using plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > >; @@ -43,7 +43,7 @@ TEST(expression, test_right) { plus_expr_type plus_expr = unity + term{{1}}; EXPECT_TRUE(( - std::is_same &&>::value )); } @@ -51,7 +51,7 @@ TEST(expression, test_right) { plus_expr_type plus_expr = unity + term{{1}}; EXPECT_TRUE(( - std::is_same &>::value )); } @@ -59,35 +59,35 @@ TEST(expression, test_right) { plus_expr_type const plus_expr = unity + term{{1}}; EXPECT_TRUE(( - std::is_same const &>::value )); } { term unity = {{1.0}}; - using plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > >; plus_expr_type plus_expr = unity + term{{1}}; - using plus_plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref, + yap::expression_ref, term > >; { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &>::value )); @@ -95,18 +95,18 @@ TEST(expression, test_right) { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &>::value )); } { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &>::value )); } @@ -114,28 +114,28 @@ TEST(expression, test_right) { term unity = {{1.0}}; - using plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > >; plus_expr_type const plus_expr = unity + term{{1}}; - using plus_plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref, + yap::expression_ref, term > >; { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same const &>::value )); @@ -143,18 +143,18 @@ TEST(expression, test_right) { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same const &>::value )); } { plus_plus_expr_type plus_plus_expr = plus_expr + term{{1}}; - bp17::expression_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); + yap::expression_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same const &>::value )); } @@ -165,7 +165,7 @@ TEST(user_expr, test_right) { user_term unity = {{1.0}}; using plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term @@ -175,7 +175,7 @@ TEST(user_expr, test_right) { plus_expr_type plus_expr = unity + user_term{{1}}; EXPECT_TRUE(( - std::is_same &&>::value )); } @@ -183,7 +183,7 @@ TEST(user_expr, test_right) { plus_expr_type plus_expr = unity + user_term{{1}}; EXPECT_TRUE(( - std::is_same &>::value )); } @@ -191,7 +191,7 @@ TEST(user_expr, test_right) { plus_expr_type const plus_expr = unity + user_term{{1}}; EXPECT_TRUE(( - std::is_same const &>::value )); } @@ -199,7 +199,7 @@ TEST(user_expr, test_right) { user_term unity = {{1.0}}; using plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term @@ -208,7 +208,7 @@ TEST(user_expr, test_right) plus_expr_type plus_expr = unity + user_term{{1}}; using plus_plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref, user_term @@ -219,7 +219,7 @@ TEST(user_expr, test_right) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &>::value )); @@ -229,7 +229,7 @@ TEST(user_expr, test_right) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &>::value )); } @@ -238,7 +238,7 @@ TEST(user_expr, test_right) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same &>::value )); } @@ -247,7 +247,7 @@ TEST(user_expr, test_right) { user_term unity = {{1.0}}; using plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term @@ -256,7 +256,7 @@ TEST(user_expr, test_right) plus_expr_type const plus_expr = unity + user_term{{1}}; using plus_plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref, user_term @@ -267,7 +267,7 @@ TEST(user_expr, test_right) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same const &>::value )); @@ -277,7 +277,7 @@ TEST(user_expr, test_right) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same const &>::value )); } @@ -286,7 +286,7 @@ TEST(user_expr, test_right) plus_plus_expr_type plus_plus_expr = plus_expr + user_term{{1}}; user_ref const plus_expr_ref = bh::front(plus_plus_expr.elements); EXPECT_TRUE(( - std::is_same const &>::value )); } diff --git a/test/user_eval_expression_as.cpp b/test/user_eval_expression_as.cpp index 60568ae..3c43fec 100644 --- a/test/user_eval_expression_as.cpp +++ b/test/user_eval_expression_as.cpp @@ -1,13 +1,13 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -30,7 +30,7 @@ namespace user { T &&... args) { return static_cast( - bp17::detail::default_eval_expr(expr, static_cast(args)...) + yap::detail::default_eval_expr(expr, static_cast(args)...) ); } @@ -41,21 +41,21 @@ TEST(user_eval_expression_as, test_user_eval_expression_as) term unity{{1.0}}; double d_ = 42.0; term i{{d_}}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref& >, + yap::expression_ref& >, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref& >, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref& >, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref& >, + yap::expression_ref& >, term > > @@ -93,17 +93,17 @@ TEST(user_eval_expression_as, test_user_eval_expression_as) } { - user::number result = bp17::evaluate_as(unity, 5, 6, 7); + user::number result = yap::evaluate_as(unity, 5, 6, 7); EXPECT_EQ(result.value, 1); } { - user::number result = bp17::evaluate_as(expr); + user::number result = yap::evaluate_as(expr); EXPECT_EQ(result.value, 43); } { - user::number result = bp17::evaluate_as(unevaluated_expr, std::string("15")); + user::number result = yap::evaluate_as(unevaluated_expr, std::string("15")); EXPECT_EQ(result.value, 44); } } diff --git a/test/user_expression_transform.cpp b/test/user_expression_transform.cpp index 4f22037..1ec2377 100644 --- a/test/user_expression_transform.cpp +++ b/test/user_expression_transform.cpp @@ -1,4 +1,4 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include @@ -7,9 +7,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -31,11 +31,11 @@ namespace user { #if 0 // TODO: Document this verbose form. auto eval_expression_as ( - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< term, term @@ -87,14 +87,14 @@ TEST(user_expression_transform, test_user_expression_transform) term y{{3.0}}; { - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< term, term @@ -112,11 +112,11 @@ TEST(user_expression_transform, test_user_expression_transform) } { - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< term, term @@ -131,15 +131,15 @@ TEST(user_expression_transform, test_user_expression_transform) } { - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< term, - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< term, term diff --git a/test/user_expression_transform_2.cpp b/test/user_expression_transform_2.cpp index 73bc8f8..8424e5b 100644 --- a/test/user_expression_transform_2.cpp +++ b/test/user_expression_transform_2.cpp @@ -1,4 +1,4 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include @@ -7,9 +7,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -31,11 +31,11 @@ namespace user { template decltype(auto) transform_expression ( - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< Expr1, Expr2 diff --git a/test/user_expression_transform_3.cpp b/test/user_expression_transform_3.cpp index 732a42c..e172e98 100644 --- a/test/user_expression_transform_3.cpp +++ b/test/user_expression_transform_3.cpp @@ -4,9 +4,9 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -33,33 +33,33 @@ namespace user { struct eval_xform_tag { - decltype(auto) operator() (bp17::terminal_tag, user::number const & n) + decltype(auto) operator() (yap::terminal_tag, user::number const & n) { return n; } }; struct eval_xform_expr { decltype(auto) operator() (term const & expr) - { return ::boost::proto17::value(expr); } + { return ::boost::yap::value(expr); } }; struct eval_xform_both { - decltype(auto) operator() (bp17::terminal_tag, user::number const & n) + decltype(auto) operator() (yap::terminal_tag, user::number const & n) { return n; } decltype(auto) operator() (term const & expr) { throw std::logic_error("Oops! Picked the wrong overload!"); - return ::boost::proto17::value(expr); + return ::boost::yap::value(expr); } }; struct plus_to_minus_xform_tag { - decltype(auto) operator() (bp17::plus_tag, user::number const & lhs, user::number const & rhs) + decltype(auto) operator() (yap::plus_tag, user::number const & lhs, user::number const & rhs) { - return bp17::make_expression( + return yap::make_expression( term{lhs}, term{rhs} ); @@ -69,87 +69,87 @@ namespace user { struct plus_to_minus_xform_expr { template - decltype(auto) operator() (bp17::expression> const & expr) + decltype(auto) operator() (yap::expression> const & expr) { - return bp17::make_expression( - ::boost::proto17::left(expr), - ::boost::proto17::right(expr) + return yap::make_expression( + ::boost::yap::left(expr), + ::boost::yap::right(expr) ); } }; struct plus_to_minus_xform_both { - decltype(auto) operator() (bp17::plus_tag, user::number const & lhs, user::number const & rhs) + decltype(auto) operator() (yap::plus_tag, user::number const & lhs, user::number const & rhs) { - return bp17::make_expression( + return yap::make_expression( term{lhs}, term{rhs} ); } template - decltype(auto) operator() (bp17::expression> const & expr) + decltype(auto) operator() (yap::expression> const & expr) { throw std::logic_error("Oops! Picked the wrong overload!"); - return bp17::make_expression( - ::boost::proto17::left(expr), - ::boost::proto17::right(expr) + return yap::make_expression( + ::boost::yap::left(expr), + ::boost::yap::right(expr) ); } }; decltype(auto) naxpy_eager_nontemplate_xform ( - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > >, - bp17::expression_ref &> + yap::expression_ref &> > > const & expr ) { auto a = evaluate(expr.left().left()); auto x = evaluate(expr.left().right()); auto y = evaluate(expr.right()); - return bp17::make_terminal(naxpy(a, x, y)); + return yap::make_terminal(naxpy(a, x, y)); } decltype(auto) naxpy_lazy_nontemplate_xform ( - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< - bp17::expression_ref &>, - bp17::expression_ref &> + yap::expression_ref &>, + yap::expression_ref &> > >, - bp17::expression_ref &> + yap::expression_ref &> > > const & expr ) { decltype(auto) a = expr.left().left().value(); decltype(auto) x = expr.left().right().value(); decltype(auto) y = expr.right().value(); - return bp17::make_terminal(naxpy)(a, x, y); + return yap::make_terminal(naxpy)(a, x, y); } struct naxpy_xform { template decltype(auto) operator() ( - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression< - bp17::expr_kind::multiplies, + yap::expression< + yap::expr_kind::multiplies, bh::tuple< Expr1, Expr2 @@ -159,7 +159,7 @@ namespace user { > > const & expr ) { - return bp17::make_terminal(naxpy)( + return yap::make_terminal(naxpy)( transform(expr.left().left(), naxpy_xform{}), transform(expr.left().right(), naxpy_xform{}), transform(expr.right(), naxpy_xform{}) @@ -315,22 +315,22 @@ TEST(move_only, test_user_expression_transform_3) { term unity{1.0}; term> i{new int{7}}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term> > > expr_1 = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref &>, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term> > > diff --git a/test/user_operator_and_eval_expression_as.cpp b/test/user_operator_and_eval_expression_as.cpp index e2fbedd..1a103c9 100644 --- a/test/user_operator_and_eval_expression_as.cpp +++ b/test/user_operator_and_eval_expression_as.cpp @@ -1,13 +1,13 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -32,7 +32,7 @@ namespace user { T &&... args) { user::number const x = - bp17::detail::default_eval_expr(expr, static_cast(args)...); + yap::detail::default_eval_expr(expr, static_cast(args)...); return user::number{x.value + 5.0}; } @@ -43,21 +43,21 @@ TEST(user_eval_expression_as, test_user_eval_expression_as) term unity{{1.0}}; double d_ = 42.0; term i{{d_}}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref& >, + yap::expression_ref& >, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref& >, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref& >, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref& >, + yap::expression_ref& >, term > > @@ -95,17 +95,17 @@ TEST(user_eval_expression_as, test_user_eval_expression_as) } { - user::number result = bp17::evaluate_as(unity, 5, 6, 7); + user::number result = yap::evaluate_as(unity, 5, 6, 7); EXPECT_EQ(result.value, 6); } { - user::number result = bp17::evaluate_as(expr); + user::number result = yap::evaluate_as(expr); EXPECT_EQ(result.value, -36); } { - user::number result = bp17::evaluate_as(unevaluated_expr, std::string("15")); + user::number result = yap::evaluate_as(unevaluated_expr, std::string("15")); EXPECT_EQ(result.value, 47); } } diff --git a/test/user_operator_eval.cpp b/test/user_operator_eval.cpp index 2057cc7..b6e14ae 100644 --- a/test/user_operator_eval.cpp +++ b/test/user_operator_eval.cpp @@ -1,13 +1,13 @@ -#define BOOST_PROTO17_CONVERSION_OPERATOR_TEMPLATE +#define BOOST_YAP_CONVERSION_OPERATOR_TEMPLATE #include "expression.hpp" #include template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; @@ -32,21 +32,21 @@ TEST(user_operator_eval, test_user_operator_eval) term unity{{1.0}}; double d_ = 42.0; term i{{d_}}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref& >, + yap::expression_ref& >, term > > expr = unity + std::move(i); - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref& >, - bp17::expression< - bp17::expr_kind::plus, + yap::expression_ref& >, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref& >, + yap::expression_ref& >, term > > diff --git a/test/value.cpp b/test/value.cpp index 3ecafcf..357ac7d 100644 --- a/test/value.cpp +++ b/test/value.cpp @@ -4,99 +4,99 @@ template -using term = boost::proto17::terminal; +using term = boost::yap::terminal; -namespace bp17 = boost::proto17; +namespace yap = boost::yap; namespace bh = boost::hana; -template +template struct user_expr { using this_type = user_expr; - static boost::proto17::expr_kind const kind = Kind; + static boost::yap::expr_kind const kind = Kind; Tuple elements; - BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) + BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(plus, this_type, ::user_expr) }; template -using user_term = boost::proto17::terminal; +using user_term = boost::yap::terminal; template -using user_ref = boost::proto17::expression_ref; +using user_ref = boost::yap::expression_ref; TEST(expression, test_value) { { term td = {{1.0}}; - EXPECT_TRUE((std::is_same::value)); - EXPECT_EQ(bp17::value(std::move(td)), 1.0); + EXPECT_TRUE((std::is_same::value)); + EXPECT_EQ(yap::value(std::move(td)), 1.0); } { term td = {{2.0}}; - EXPECT_TRUE((std::is_same::value)); - EXPECT_EQ(bp17::value(td), 2.0); + EXPECT_TRUE((std::is_same::value)); + EXPECT_EQ(yap::value(td), 2.0); } { term const td = {{3.0}}; - EXPECT_TRUE((std::is_same::value)); - EXPECT_EQ(bp17::value(td), 3.0); + EXPECT_TRUE((std::is_same::value)); + EXPECT_EQ(yap::value(td), 3.0); } term unity = {{1.0}}; - using plus_expr_type = bp17::expression< - bp17::expr_kind::plus, + using plus_expr_type = yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref &>, + yap::expression_ref &>, term > >; plus_expr_type plus_expr = unity + term{{1}}; { - bp17::expression_ref &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same &>::value)); + yap::expression_ref &> ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same &>::value)); } { - bp17::expression_ref &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same &>::value)); + yap::expression_ref &> ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same &>::value)); } { - bp17::expression_ref &> const ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same &>::value)); + yap::expression_ref &> const ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same &>::value)); } { term const unity = {{1.0}}; - bp17::expression< - bp17::expr_kind::plus, + yap::expression< + yap::expr_kind::plus, bh::tuple< - bp17::expression_ref const &>, + yap::expression_ref const &>, term > > plus_expr = unity + term{{1}}; { - bp17::expression_ref const &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same const &>::value)); + yap::expression_ref const &> ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same const &>::value)); } { - bp17::expression_ref const &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same const &>::value)); + yap::expression_ref const &> ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same const &>::value)); } { - bp17::expression_ref const &> const ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same const &>::value)); + yap::expression_ref const &> const ref = bh::front(plus_expr.elements); + EXPECT_TRUE((std::is_same const &>::value)); } } } @@ -105,25 +105,25 @@ TEST(user_expr, test_value) { { user_term td = {{1.0}}; - EXPECT_TRUE((std::is_same::value)); - EXPECT_EQ(bp17::value(std::move(td)), 1.0); + EXPECT_TRUE((std::is_same::value)); + EXPECT_EQ(yap::value(std::move(td)), 1.0); } { user_term td = {{2.0}}; - EXPECT_TRUE((std::is_same::value)); - EXPECT_EQ(bp17::value(td), 2.0); + EXPECT_TRUE((std::is_same::value)); + EXPECT_EQ(yap::value(td), 2.0); } { user_term const td = {{3.0}}; - EXPECT_TRUE((std::is_same::value)); - EXPECT_EQ(bp17::value(td), 3.0); + EXPECT_TRUE((std::is_same::value)); + EXPECT_EQ(yap::value(td), 3.0); } user_term unity = {{1.0}}; using plus_expr_type = user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref &>, user_term @@ -133,23 +133,23 @@ TEST(user_expr, test_value) { user_ref &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same &>::value)); + EXPECT_TRUE((std::is_same &>::value)); } { user_ref &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same &>::value)); + EXPECT_TRUE((std::is_same &>::value)); } { user_ref &> const ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same &>::value)); + EXPECT_TRUE((std::is_same &>::value)); } { user_term const unity = {{1.0}}; user_expr< - bp17::expr_kind::plus, + yap::expr_kind::plus, bh::tuple< user_ref const &>, user_term @@ -158,17 +158,17 @@ TEST(user_expr, test_value) { user_ref const &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same const &>::value)); + EXPECT_TRUE((std::is_same const &>::value)); } { user_ref const &> ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same const &>::value)); + EXPECT_TRUE((std::is_same const &>::value)); } { user_ref const &> const ref = bh::front(plus_expr.elements); - EXPECT_TRUE((std::is_same const &>::value)); + EXPECT_TRUE((std::is_same const &>::value)); } } } diff --git a/user_macros.hpp b/user_macros.hpp index 88dd172..a81ccde 100644 --- a/user_macros.hpp +++ b/user_macros.hpp @@ -1,141 +1,141 @@ -#ifndef BOOST_PROTO17_USER_MACROS_HPP_INCLUDED -#define BOOST_PROTO17_USER_MACROS_HPP_INCLUDED +#ifndef BOOST_YAP_USER_MACROS_HPP_INCLUDED +#define BOOST_YAP_USER_MACROS_HPP_INCLUDED #include // unary -#define BOOST_PROTO17_OPERATOR_unary_plus(param_list) + param_list -#define BOOST_PROTO17_OPERATOR_negate(param_list) - param_list -#define BOOST_PROTO17_OPERATOR_dereference(param_list) * param_list -#define BOOST_PROTO17_OPERATOR_complement(param_list) ~ param_list -#define BOOST_PROTO17_OPERATOR_address_of(param_list) & param_list -#define BOOST_PROTO17_OPERATOR_logical_not(param_list) ! param_list -#define BOOST_PROTO17_OPERATOR_pre_inc(param_list) ++ param_list -#define BOOST_PROTO17_OPERATOR_pre_dec(param_list) -- param_list -#define BOOST_PROTO17_OPERATOR_post_inc(param_list) ++ (int) -#define BOOST_PROTO17_OPERATOR_post_dec(param_list) -- (int) +#define BOOST_YAP_OPERATOR_unary_plus(param_list) + param_list +#define BOOST_YAP_OPERATOR_negate(param_list) - param_list +#define BOOST_YAP_OPERATOR_dereference(param_list) * param_list +#define BOOST_YAP_OPERATOR_complement(param_list) ~ param_list +#define BOOST_YAP_OPERATOR_address_of(param_list) & param_list +#define BOOST_YAP_OPERATOR_logical_not(param_list) ! param_list +#define BOOST_YAP_OPERATOR_pre_inc(param_list) ++ param_list +#define BOOST_YAP_OPERATOR_pre_dec(param_list) -- param_list +#define BOOST_YAP_OPERATOR_post_inc(param_list) ++ (int) +#define BOOST_YAP_OPERATOR_post_dec(param_list) -- (int) // binary -#define BOOST_PROTO17_OPERATOR_shift_left() << -#define BOOST_PROTO17_OPERATOR_shift_right() >> -#define BOOST_PROTO17_OPERATOR_multiplies() * -#define BOOST_PROTO17_OPERATOR_divides() / -#define BOOST_PROTO17_OPERATOR_modulus() % -#define BOOST_PROTO17_OPERATOR_plus() + -#define BOOST_PROTO17_OPERATOR_minus() - -#define BOOST_PROTO17_OPERATOR_less() < -#define BOOST_PROTO17_OPERATOR_greater() > -#define BOOST_PROTO17_OPERATOR_less_equal() <= -#define BOOST_PROTO17_OPERATOR_greater_equal() >= -#define BOOST_PROTO17_OPERATOR_equal_to() == -#define BOOST_PROTO17_OPERATOR_not_equal_to() != -#define BOOST_PROTO17_OPERATOR_logical_or() || -#define BOOST_PROTO17_OPERATOR_logical_and() && -#define BOOST_PROTO17_OPERATOR_bitwise_and() & -#define BOOST_PROTO17_OPERATOR_bitwise_or() | -#define BOOST_PROTO17_OPERATOR_bitwise_xor() ^ -#define BOOST_PROTO17_OPERATOR_comma() , -#define BOOST_PROTO17_OPERATOR_mem_ptr() ->* -#define BOOST_PROTO17_OPERATOR_assign() = -#define BOOST_PROTO17_OPERATOR_shift_left_assign() <<= -#define BOOST_PROTO17_OPERATOR_shift_right_assign() >>= -#define BOOST_PROTO17_OPERATOR_multiplies_assign() *= -#define BOOST_PROTO17_OPERATOR_divides_assign() /= -#define BOOST_PROTO17_OPERATOR_modulus_assign() %= -#define BOOST_PROTO17_OPERATOR_plus_assign() += -#define BOOST_PROTO17_OPERATOR_minus_assign() -= -#define BOOST_PROTO17_OPERATOR_bitwise_and_assign() &= -#define BOOST_PROTO17_OPERATOR_bitwise_or_assign() |= -#define BOOST_PROTO17_OPERATOR_bitwise_xor_assign() ^= -#define BOOST_PROTO17_OPERATOR_subscript() [] +#define BOOST_YAP_OPERATOR_shift_left() << +#define BOOST_YAP_OPERATOR_shift_right() >> +#define BOOST_YAP_OPERATOR_multiplies() * +#define BOOST_YAP_OPERATOR_divides() / +#define BOOST_YAP_OPERATOR_modulus() % +#define BOOST_YAP_OPERATOR_plus() + +#define BOOST_YAP_OPERATOR_minus() - +#define BOOST_YAP_OPERATOR_less() < +#define BOOST_YAP_OPERATOR_greater() > +#define BOOST_YAP_OPERATOR_less_equal() <= +#define BOOST_YAP_OPERATOR_greater_equal() >= +#define BOOST_YAP_OPERATOR_equal_to() == +#define BOOST_YAP_OPERATOR_not_equal_to() != +#define BOOST_YAP_OPERATOR_logical_or() || +#define BOOST_YAP_OPERATOR_logical_and() && +#define BOOST_YAP_OPERATOR_bitwise_and() & +#define BOOST_YAP_OPERATOR_bitwise_or() | +#define BOOST_YAP_OPERATOR_bitwise_xor() ^ +#define BOOST_YAP_OPERATOR_comma() , +#define BOOST_YAP_OPERATOR_mem_ptr() ->* +#define BOOST_YAP_OPERATOR_assign() = +#define BOOST_YAP_OPERATOR_shift_left_assign() <<= +#define BOOST_YAP_OPERATOR_shift_right_assign() >>= +#define BOOST_YAP_OPERATOR_multiplies_assign() *= +#define BOOST_YAP_OPERATOR_divides_assign() /= +#define BOOST_YAP_OPERATOR_modulus_assign() %= +#define BOOST_YAP_OPERATOR_plus_assign() += +#define BOOST_YAP_OPERATOR_minus_assign() -= +#define BOOST_YAP_OPERATOR_bitwise_and_assign() &= +#define BOOST_YAP_OPERATOR_bitwise_or_assign() |= +#define BOOST_YAP_OPERATOR_bitwise_xor_assign() ^= +#define BOOST_YAP_OPERATOR_subscript() [] -#define BOOST_PROTO17_INDIRECT_CALL(macro) BOOST_PP_CAT(BOOST_PROTO17_OPERATOR_, macro) +#define BOOST_YAP_INDIRECT_CALL(macro) BOOST_PP_CAT(BOOST_YAP_OPERATOR_, macro) -#define BOOST_PROTO17_USER_UNARY_OPERATOR_MEMBER(op_name, this_type, expr_template) \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)(()) const & \ +#define BOOST_YAP_USER_UNARY_OPERATOR_MEMBER(op_name, this_type, expr_template) \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)(()) const & \ { \ - using lhs_type = ::boost::proto17::detail::expr_ref_t; \ - using lhs_tuple_type = ::boost::proto17::detail::expr_ref_tuple_t; \ + using lhs_type = ::boost::yap::detail::expr_ref_t; \ + using lhs_tuple_type = ::boost::yap::detail::expr_ref_tuple_t; \ using tuple_type = ::boost::hana::tuple; \ - return expr_template< ::boost::proto17::expr_kind::op_name, tuple_type>{ \ + return expr_template< ::boost::yap::expr_kind::op_name, tuple_type>{ \ tuple_type{lhs_type{lhs_tuple_type{this}}} \ }; \ } \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)(()) & \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)(()) & \ { \ - using lhs_type = ::boost::proto17::detail::expr_ref_t; \ - using lhs_tuple_type = ::boost::proto17::detail::expr_ref_tuple_t; \ + using lhs_type = ::boost::yap::detail::expr_ref_t; \ + using lhs_tuple_type = ::boost::yap::detail::expr_ref_tuple_t; \ using tuple_type = ::boost::hana::tuple; \ - return expr_template< ::boost::proto17::expr_kind::op_name, tuple_type>{ \ + return expr_template< ::boost::yap::expr_kind::op_name, tuple_type>{ \ tuple_type{lhs_type{lhs_tuple_type{this}}} \ }; \ } \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)(()) && \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)(()) && \ { \ using tuple_type = ::boost::hana::tuple; \ - return expr_template< ::boost::proto17::expr_kind::op_name, tuple_type>{ \ + return expr_template< ::boost::yap::expr_kind::op_name, tuple_type>{ \ tuple_type{std::move(*this)} \ }; \ } -#define BOOST_PROTO17_USER_BINARY_OPERATOR_MEMBER(op_name, this_type, expr_template) \ +#define BOOST_YAP_USER_BINARY_OPERATOR_MEMBER(op_name, this_type, expr_template) \ template \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)() (Expr && rhs) const & \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)() (Expr && rhs) const & \ { \ - using lhs_type = ::boost::proto17::detail::expr_ref_t; \ - using lhs_tuple_type = ::boost::proto17::detail::expr_ref_tuple_t; \ - using rhs_type = ::boost::proto17::detail::operand_type_t; \ + using lhs_type = ::boost::yap::detail::expr_ref_t; \ + using lhs_tuple_type = ::boost::yap::detail::expr_ref_tuple_t; \ + using rhs_type = ::boost::yap::detail::operand_type_t; \ using tuple_type = ::boost::hana::tuple; \ - return expr_template< ::boost::proto17::expr_kind::op_name, tuple_type>{ \ + return expr_template< ::boost::yap::expr_kind::op_name, tuple_type>{ \ tuple_type{ \ lhs_type{lhs_tuple_type{this}}, \ - ::boost::proto17::detail::make_operand{}(static_cast(rhs)) \ + ::boost::yap::detail::make_operand{}(static_cast(rhs)) \ } \ }; \ } \ template \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)() (Expr && rhs) & \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)() (Expr && rhs) & \ { \ - using lhs_type = ::boost::proto17::detail::expr_ref_t; \ - using lhs_tuple_type = ::boost::proto17::detail::expr_ref_tuple_t; \ - using rhs_type = ::boost::proto17::detail::operand_type_t; \ + using lhs_type = ::boost::yap::detail::expr_ref_t; \ + using lhs_tuple_type = ::boost::yap::detail::expr_ref_tuple_t; \ + using rhs_type = ::boost::yap::detail::operand_type_t; \ using tuple_type = ::boost::hana::tuple; \ - return expr_template< ::boost::proto17::expr_kind::op_name, tuple_type>{ \ + return expr_template< ::boost::yap::expr_kind::op_name, tuple_type>{ \ tuple_type{ \ lhs_type{lhs_tuple_type{this}}, \ - ::boost::proto17::detail::make_operand{}(static_cast(rhs)) \ + ::boost::yap::detail::make_operand{}(static_cast(rhs)) \ } \ }; \ } \ template \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)() (Expr && rhs) && \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)() (Expr && rhs) && \ { \ - using rhs_type = ::boost::proto17::detail::operand_type_t; \ + using rhs_type = ::boost::yap::detail::operand_type_t; \ using tuple_type = ::boost::hana::tuple; \ - return expr_template< ::boost::proto17::expr_kind::op_name, tuple_type>{ \ + return expr_template< ::boost::yap::expr_kind::op_name, tuple_type>{ \ tuple_type{ \ std::move(*this), \ - ::boost::proto17::detail::make_operand{}(static_cast(rhs)) \ + ::boost::yap::detail::make_operand{}(static_cast(rhs)) \ } \ }; \ } -#define BOOST_PROTO17_USER_MEMBER_CALL_OPERATOR(this_type, expr_template) \ +#define BOOST_YAP_USER_MEMBER_CALL_OPERATOR(this_type, expr_template) \ template \ auto operator() (U && ...u) const & \ { \ - using lhs_type = ::boost::proto17::detail::expr_ref_t; \ - using lhs_tuple_type = ::boost::proto17::detail::expr_ref_tuple_t; \ + using lhs_type = ::boost::yap::detail::expr_ref_t; \ + using lhs_tuple_type = ::boost::yap::detail::expr_ref_tuple_t; \ using tuple_type = ::boost::hana::tuple< \ lhs_type, \ - ::boost::proto17::detail::operand_type_t... \ + ::boost::yap::detail::operand_type_t... \ >; \ - return expr_template< ::boost::proto17::expr_kind::call, tuple_type>{ \ + return expr_template< ::boost::yap::expr_kind::call, tuple_type>{ \ tuple_type{ \ lhs_type{lhs_tuple_type{this}}, \ - ::boost::proto17::detail::make_operand< \ - ::boost::proto17::detail::operand_type_t \ + ::boost::yap::detail::make_operand< \ + ::boost::yap::detail::operand_type_t \ >{}(static_cast(u))... \ } \ }; \ @@ -143,17 +143,17 @@ template \ auto operator() (U && ...u) & \ { \ - using lhs_type = ::boost::proto17::detail::expr_ref_t; \ - using lhs_tuple_type = ::boost::proto17::detail::expr_ref_tuple_t; \ + using lhs_type = ::boost::yap::detail::expr_ref_t; \ + using lhs_tuple_type = ::boost::yap::detail::expr_ref_tuple_t; \ using tuple_type = ::boost::hana::tuple< \ lhs_type, \ - ::boost::proto17::detail::operand_type_t... \ + ::boost::yap::detail::operand_type_t... \ >; \ - return expr_template< ::boost::proto17::expr_kind::call, tuple_type>{ \ + return expr_template< ::boost::yap::expr_kind::call, tuple_type>{ \ tuple_type{ \ lhs_type{lhs_tuple_type{this}}, \ - ::boost::proto17::detail::make_operand< \ - ::boost::proto17::detail::operand_type_t \ + ::boost::yap::detail::make_operand< \ + ::boost::yap::detail::operand_type_t \ >{}(static_cast(u))... \ } \ }; \ @@ -163,32 +163,32 @@ { \ using tuple_type = ::boost::hana::tuple< \ this_type, \ - ::boost::proto17::detail::operand_type_t... \ + ::boost::yap::detail::operand_type_t... \ >; \ - return expr_template< ::boost::proto17::expr_kind::call, tuple_type>{ \ + return expr_template< ::boost::yap::expr_kind::call, tuple_type>{ \ tuple_type{ \ std::move(*this), \ - ::boost::proto17::detail::make_operand< \ - ::boost::proto17::detail::operand_type_t \ + ::boost::yap::detail::make_operand< \ + ::boost::yap::detail::operand_type_t \ >{}(static_cast(u))... \ } \ }; \ } -#define BOOST_PROTO17_USER_FREE_BINARY_OPERATOR(op_name, expr_template) \ +#define BOOST_YAP_USER_FREE_BINARY_OPERATOR(op_name, expr_template) \ template \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)() (T && lhs, Expr && rhs) \ - -> ::boost::proto17::detail::free_binary_op_result_t< \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)() (T && lhs, Expr && rhs) \ + -> ::boost::yap::detail::free_binary_op_result_t< \ expr_template, \ - ::boost::proto17::expr_kind::op_name, \ + ::boost::yap::expr_kind::op_name, \ T, \ Expr && \ > \ { \ - using result_types = ::boost::proto17::detail::free_binary_op_result< \ + using result_types = ::boost::yap::detail::free_binary_op_result< \ expr_template, \ - ::boost::proto17::expr_kind::op_name, \ + ::boost::yap::expr_kind::op_name, \ T, \ Expr && \ >; \ @@ -214,17 +214,17 @@ } \ -#define BOOST_PROTO17_USER_EXPR_IF_ELSE(expr_template) \ +#define BOOST_YAP_USER_EXPR_IF_ELSE(expr_template) \ template \ auto if_else (Expr1 && expr1, Expr2 && expr2, Expr3 && expr3) \ - -> ::boost::proto17::detail::ternary_op_result_t< \ + -> ::boost::yap::detail::ternary_op_result_t< \ expr_template, \ Expr1, \ Expr2, \ Expr3 \ > \ { \ - using result_types = ::boost::proto17::detail::ternary_op_result< \ + using result_types = ::boost::yap::detail::ternary_op_result< \ expr_template, \ Expr1, \ Expr2, \ @@ -236,18 +236,18 @@ using tuple_type = ::boost::hana::tuple; \ return { \ tuple_type{ \ - ::boost::proto17::detail::make_operand{}(static_cast(expr1)), \ - ::boost::proto17::detail::make_operand{}(static_cast(expr2)), \ - ::boost::proto17::detail::make_operand{}(static_cast(expr3)) \ + ::boost::yap::detail::make_operand{}(static_cast(expr1)), \ + ::boost::yap::detail::make_operand{}(static_cast(expr2)), \ + ::boost::yap::detail::make_operand{}(static_cast(expr3)) \ } \ }; \ } -#define BOOST_PROTO17_USER_UDT_ANY_IF_ELSE(expr_template, udt_trait) \ +#define BOOST_YAP_USER_UDT_ANY_IF_ELSE(expr_template, udt_trait) \ template \ auto if_else (Expr1 && expr1, Expr2 && expr2, Expr3 && expr3) \ - -> ::boost::proto17::detail::udt_any_ternary_op_result_t< \ + -> ::boost::yap::detail::udt_any_ternary_op_result_t< \ expr_template, \ Expr1, \ Expr2, \ @@ -255,7 +255,7 @@ udt_trait \ > \ { \ - using result_types = ::boost::proto17::detail::udt_any_ternary_op_result< \ + using result_types = ::boost::yap::detail::udt_any_ternary_op_result< \ expr_template, \ Expr1, \ Expr2, \ @@ -268,27 +268,27 @@ using tuple_type = ::boost::hana::tuple; \ return { \ tuple_type{ \ - ::boost::proto17::detail::make_operand{}(static_cast(expr1)), \ - ::boost::proto17::detail::make_operand{}(static_cast(expr2)), \ - ::boost::proto17::detail::make_operand{}(static_cast(expr3)) \ + ::boost::yap::detail::make_operand{}(static_cast(expr1)), \ + ::boost::yap::detail::make_operand{}(static_cast(expr2)), \ + ::boost::yap::detail::make_operand{}(static_cast(expr3)) \ } \ }; \ } -#define BOOST_PROTO17_USER_UDT_UNARY_OPERATOR(op_name, expr_template, udt_trait) \ +#define BOOST_YAP_USER_UDT_UNARY_OPERATOR(op_name, expr_template, udt_trait) \ template \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)((T && x)) \ - -> ::boost::proto17::detail::udt_unary_op_result_t< \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)((T && x)) \ + -> ::boost::yap::detail::udt_unary_op_result_t< \ expr_template, \ - ::boost::proto17::expr_kind::op_name, \ + ::boost::yap::expr_kind::op_name, \ T, \ udt_trait \ > \ { \ - using result_types = ::boost::proto17::detail::udt_unary_op_result< \ + using result_types = ::boost::yap::detail::udt_unary_op_result< \ expr_template, \ - ::boost::proto17::expr_kind::op_name, \ + ::boost::yap::expr_kind::op_name, \ T, \ udt_trait \ >; \ @@ -298,21 +298,21 @@ } \ -#define BOOST_PROTO17_USER_UDT_UDT_BINARY_OPERATOR(op_name, expr_template, t_udt_trait, u_udt_trait) \ +#define BOOST_YAP_USER_UDT_UDT_BINARY_OPERATOR(op_name, expr_template, t_udt_trait, u_udt_trait) \ template \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)() (T && lhs, U && rhs) \ - -> ::boost::proto17::detail::udt_udt_binary_op_result_t< \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)() (T && lhs, U && rhs) \ + -> ::boost::yap::detail::udt_udt_binary_op_result_t< \ expr_template, \ - ::boost::proto17::expr_kind::op_name, \ + ::boost::yap::expr_kind::op_name, \ T, \ U, \ t_udt_trait, \ u_udt_trait \ > \ { \ - using result_types = ::boost::proto17::detail::udt_udt_binary_op_result< \ + using result_types = ::boost::yap::detail::udt_udt_binary_op_result< \ expr_template, \ - ::boost::proto17::expr_kind::op_name, \ + ::boost::yap::expr_kind::op_name, \ T, \ U, \ t_udt_trait, \ @@ -330,20 +330,20 @@ } \ -#define BOOST_PROTO17_USER_UDT_ANY_BINARY_OPERATOR(op_name, expr_template, udt_trait) \ +#define BOOST_YAP_USER_UDT_ANY_BINARY_OPERATOR(op_name, expr_template, udt_trait) \ template \ - auto operator BOOST_PROTO17_INDIRECT_CALL(op_name)() (T && lhs, U && rhs) \ - -> ::boost::proto17::detail::udt_any_binary_op_result_t< \ + auto operator BOOST_YAP_INDIRECT_CALL(op_name)() (T && lhs, U && rhs) \ + -> ::boost::yap::detail::udt_any_binary_op_result_t< \ expr_template, \ - ::boost::proto17::expr_kind::op_name, \ + ::boost::yap::expr_kind::op_name, \ T, \ U, \ udt_trait \ > \ { \ - using result_types = ::boost::proto17::detail::udt_any_binary_op_result< \ + using result_types = ::boost::yap::detail::udt_any_binary_op_result< \ expr_template, \ - ::boost::proto17::expr_kind::op_name, \ + ::boost::yap::expr_kind::op_name, \ T, \ U, \ udt_trait \