annotate DEPENDENCIES/generic/include/boost/phoenix/statement/do_while.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 /*==============================================================================
Chris@16 2 Copyright (c) 2001-2010 Joel de Guzman
Chris@16 3 Copyright (c) 2010 Thomas Heller
Chris@16 4
Chris@16 5 Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 7 ==============================================================================*/
Chris@16 8 #ifndef BOOST_PHOENIX_STATEMENT_DO_WHILE_HPP
Chris@16 9 #define BOOST_PHOENIX_STATEMENT_DO_WHILE_HPP
Chris@16 10
Chris@16 11 #include <boost/phoenix/core/limits.hpp>
Chris@16 12 #include <boost/phoenix/core/call.hpp>
Chris@16 13 #include <boost/phoenix/core/expression.hpp>
Chris@16 14 #include <boost/phoenix/core/meta_grammar.hpp>
Chris@16 15
Chris@16 16 BOOST_PHOENIX_DEFINE_EXPRESSION(
Chris@16 17 (boost)(phoenix)(do_while)
Chris@16 18 , (meta_grammar) // Cond
Chris@16 19 (meta_grammar) // Do
Chris@16 20 )
Chris@16 21
Chris@16 22 namespace boost { namespace phoenix
Chris@16 23 {
Chris@16 24 struct do_while_eval
Chris@16 25 {
Chris@16 26 typedef void result_type;
Chris@16 27
Chris@16 28 template <typename Cond, typename Do, typename Context>
Chris@16 29 result_type
Chris@101 30 operator()(Cond const& cond, Do const& do_it, Context const & ctx) const
Chris@16 31 {
Chris@16 32 do
Chris@101 33 boost::phoenix::eval(do_it, ctx);
Chris@16 34 while (boost::phoenix::eval(cond, ctx));
Chris@16 35 }
Chris@16 36 };
Chris@16 37
Chris@16 38 template <typename Dummy>
Chris@16 39 struct default_actions::when<rule::do_while, Dummy>
Chris@16 40 : call<do_while_eval, Dummy>
Chris@16 41 {};
Chris@16 42
Chris@16 43 template <typename Do>
Chris@16 44 struct do_while_gen
Chris@16 45 {
Chris@101 46 do_while_gen(Do const& do_it)
Chris@101 47 : do_(do_it) {}
Chris@16 48
Chris@16 49 template <typename Cond>
Chris@16 50 typename expression::do_while<Cond, Do>::type const
Chris@16 51 while_(Cond const& cond) const
Chris@16 52 {
Chris@16 53 return expression::do_while<Cond, Do>::make(cond, do_);
Chris@16 54 }
Chris@16 55
Chris@16 56 Do const& do_;
Chris@16 57 };
Chris@16 58
Chris@16 59 struct do_gen
Chris@16 60 {
Chris@16 61 template <typename Do>
Chris@16 62 do_while_gen<Do> const
Chris@16 63 operator[](Do const& do_) const
Chris@16 64 {
Chris@16 65 return do_while_gen<Do>(do_);
Chris@16 66 }
Chris@16 67 };
Chris@16 68
Chris@16 69 #ifndef BOOST_PHOENIX_NO_PREDEFINED_TERMINALS
Chris@16 70 do_gen const do_ = {};
Chris@16 71 #endif
Chris@16 72
Chris@16 73 }}
Chris@16 74
Chris@16 75 #endif