]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/proto/example/hello.cpp
2 ////////////////////////////////////////////////////////////////////
3 // Copyright 2008 Eric Niebler. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/proto/core.hpp>
9 #include <boost/proto/context.hpp>
10 // This #include is only needed for compilers that use typeof emulation:
11 #include <boost/typeof/std/ostream.hpp>
12 namespace proto
= boost::proto
;
14 proto::terminal
< std::ostream
& >::type cout_
= {std::cout
};
16 template< typename Expr
>
17 void evaluate( Expr
const & expr
)
19 proto::default_context ctx
;
20 proto::eval(expr
, ctx
);
25 evaluate( cout_
<< "hello" << ',' << " world" );