]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/yap/example/minimal.cpp
1 // Copyright (C) 2016-2018 T. Zachary Laine
3 // Distributed under the Boost Software License, Version 1.0. (See
4 // accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 #include <boost/yap/algorithm.hpp>
13 template <boost::yap::expr_kind Kind
, typename Tuple
>
16 static const boost::yap::expr_kind kind
= Kind
;
25 //[ minimal_template_manual_construction
26 auto left
= boost::yap::make_terminal
<minimal_expr
>(1);
27 auto right
= boost::yap::make_terminal
<minimal_expr
>(41);
29 auto expr
= boost::yap::make_expression
<
31 boost::yap::expr_kind::plus
35 //[ minimal_template_evaluation
36 auto result
= boost::yap::evaluate(expr
);
38 std::cout
<< result
<< "\n"; // prints "42"