diff options
Diffstat (limited to 'boost/proto/debug.hpp')
-rw-r--r-- | boost/proto/debug.hpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/boost/proto/debug.hpp b/boost/proto/debug.hpp index f732bc2a99..7d3e42fce0 100644 --- a/boost/proto/debug.hpp +++ b/boost/proto/debug.hpp @@ -11,14 +11,14 @@ #include <iostream> #include <boost/preprocessor/stringize.hpp> -#include <boost/ref.hpp> +#include <boost/core/ref.hpp> +#include <boost/core/typeinfo.hpp> #include <boost/mpl/assert.hpp> #include <boost/proto/proto_fwd.hpp> #include <boost/proto/traits.hpp> #include <boost/proto/matches.hpp> #include <boost/proto/fusion.hpp> #include <boost/fusion/algorithm/iteration/for_each.hpp> -#include <boost/detail/sp_typeinfo.hpp> namespace boost { namespace proto { @@ -100,7 +100,7 @@ namespace boost { namespace proto { template<typename T> named_any(T const &) - : name_(BOOST_SP_TYPEID(T).name()) + : name_(BOOST_CORE_TYPEID(T).name()) {} char const *name_; @@ -114,6 +114,23 @@ namespace boost { namespace proto namespace detail { + // copyable functor to pass by value to fusion::foreach + struct display_expr_impl; + struct display_expr_impl_functor + { + display_expr_impl_functor(display_expr_impl const& impl): impl_(impl) + {} + + template<typename Expr> + void operator()(Expr const &expr) const + { + this->impl_(expr); + } + + private: + display_expr_impl const& impl_; + }; + struct display_expr_impl { explicit display_expr_impl(std::ostream &sout, int depth = 0) @@ -152,7 +169,7 @@ namespace boost { namespace proto this->sout_ << (this->first_? "" : ", "); this->sout_ << tag() << "(\n"; display_expr_impl display(this->sout_, this->depth_ + 4); - fusion::for_each(expr, display); + fusion::for_each(expr, display_expr_impl_functor(display)); this->sout_.width(this->depth_); this->sout_ << "" << ")\n"; this->first_ = false; |