// Copyright (C) 2016-2018 T. Zachary Laine // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include template using term = boost::yap::terminal; template using ref = boost::yap::expression_ref; namespace yap = boost::yap; namespace bh = boost::hana; void compile_const_term() { { term unity{1.0}; int i_ = 42; term i{std::move(i_)}; yap::expression< yap::expr_kind::plus, bh::tuple &>, term>> expr = unity + std::move(i); yap::expression< yap::expr_kind::plus, bh::tuple< ref &>, yap::expression< yap::expr_kind::plus, bh::tuple &>, term>>>> unevaluated_expr = unity + std::move(expr); (void)unevaluated_expr; } { term const unity{1.0}; int i_ = 42; term i{std::move(i_)}; yap::expression< yap::expr_kind::plus, bh::tuple const &>, term>> expr = unity + std::move(i); yap::expression< yap::expr_kind::plus, bh::tuple< ref const &>, yap::expression< yap::expr_kind::plus, bh::tuple const &>, term>>>> unevaluated_expr = unity + std::move(expr); (void)unevaluated_expr; } { term unity{1.0}; int i_ = 42; term i{i_}; yap::expression< yap::expr_kind::plus, bh::tuple &>, term>> const expr = unity + std::move(i); yap::expression< yap::expr_kind::plus, bh::tuple< ref &>, yap::expression< yap::expr_kind::plus, bh::tuple &>, term>>>> unevaluated_expr = unity + std::move(expr); (void)unevaluated_expr; } }