Chris@16: /*============================================================================= Chris@16: Copyright (c) 2001-2007 Joel de Guzman Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: ==============================================================================*/ Chris@16: #ifndef PHOENIX_STATEMENT_WHILE_HPP Chris@16: #define PHOENIX_STATEMENT_WHILE_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace phoenix Chris@16: { Chris@16: struct while_eval Chris@16: { Chris@16: template Chris@16: struct result Chris@16: { Chris@16: typedef void type; Chris@16: }; Chris@16: Chris@16: template Chris@16: static void Chris@16: eval(Env const& env, Cond& cond, Do& do_) Chris@16: { Chris@16: while (cond.eval(env)) Chris@16: do_.eval(env); Chris@16: } Chris@16: }; Chris@16: Chris@16: template Chris@16: struct while_gen Chris@16: { Chris@16: while_gen(Cond const& cond) Chris@16: : cond(cond) {} Chris@16: Chris@16: template Chris@16: actor::type> Chris@16: operator[](Do const& do_) const Chris@16: { Chris@16: return compose(cond, do_); Chris@16: } Chris@16: Chris@16: Cond cond; Chris@16: }; Chris@16: Chris@16: template Chris@16: inline while_gen Chris@16: while_(Cond const& cond) Chris@16: { Chris@16: return while_gen(cond); Chris@16: } Chris@16: }} Chris@16: Chris@16: #endif