1 /*==============================================================================
2 Copyright (c) 2005-2010 Joel de Guzman
3 Copyright (c) 2010 Thomas Heller
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #ifndef BOOST_PHOENIX_CORE_VISIT_EACH_HPP
9 #define BOOST_PHOENIX_CORE_VISIT_EACH_HPP
11 #include <boost/phoenix/core/limits.hpp>
12 #include <boost/fusion/algorithm/iteration/for_each.hpp>
13 #include <boost/visit_each.hpp>
15 namespace boost { namespace phoenix
17 template <typename> struct actor;
21 template <typename Visitor>
22 struct visit_each_impl
25 visit_each_impl(Visitor& visitor_ ) : visitor(visitor_) {}
28 void operator()(T const& t) const
30 using boost::visit_each;
31 visit_each(visitor, t);
36 template <typename Visitor, typename Expr>
37 inline void visit_each(Visitor& visitor, actor<Expr> const& a, long)
39 fusion::for_each(a, detail::visit_each_impl<Visitor>(visitor));
42 template <typename Visitor, typename Expr>
43 inline void visit_each(Visitor& visitor, actor<Expr> const& a)
45 fusion::for_each(a, detail::visit_each_impl<Visitor>(visitor));