#include #include #include template using term = boost::yap::terminal; template using ref = boost::yap::expression_ref; namespace yap = boost::yap; namespace bh = boost::hana; void compile_x_plus_term () { using namespace std::literals; // char const * string { term unity{1.0}; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = "3" + unity; (void)unevaluated_expr; } // std::string temporary { term const unity{1.0}; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref const &> > > unevaluated_expr = "3"s + unity; (void)unevaluated_expr; } // arrays { term unity{1.0}; int ints[] = {1, 2}; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = ints + unity; (void)unevaluated_expr; } { term unity{1.0}; int const ints[] = {1, 2}; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = ints + unity; (void)unevaluated_expr; } { term unity{1.0}; int ints[] = {1, 2}; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = std::move(ints) + unity; (void)unevaluated_expr; } // pointers { term unity{1.0}; int ints[] = {1, 2}; int * int_ptr = ints; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = int_ptr + unity; (void)unevaluated_expr; } { term unity{1.0}; int const ints[] = {1, 2}; int const * int_ptr = ints; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = int_ptr + unity; (void)unevaluated_expr; } { term unity{1.0}; int ints[] = {1, 2}; int * int_ptr = ints; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = std::move(int_ptr) + unity; (void)unevaluated_expr; } // const pointers { term unity{1.0}; int ints[] = {1, 2}; int * const int_ptr = ints; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = int_ptr + unity; (void)unevaluated_expr; } { term unity{1.0}; int const ints[] = {1, 2}; int const * const int_ptr = ints; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = int_ptr + unity; (void)unevaluated_expr; } { term unity{1.0}; int ints[] = {1, 2}; int * const int_ptr = ints; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = std::move(int_ptr) + unity; (void)unevaluated_expr; } // values { term unity{1.0}; int i = 1; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = i + unity; (void)unevaluated_expr; } { term unity{1.0}; int const i = 1; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = i + unity; (void)unevaluated_expr; } { term unity{1.0}; int i = 1; yap::expression< yap::expr_kind::plus, bh::tuple< term, ref &> > > unevaluated_expr = std::move(i) + unity; (void)unevaluated_expr; } }