debug.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*==============================================================================
  2. Copyright (c) 2005-2010 Joel de Guzman
  3. Copyright (c) 2010 Thomas Heller
  4. Copyright (c) 2014 John Fletcher
  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_DEBUG_HPP
  9. #define BOOST_PHOENIX_DEBUG_HPP
  10. #include <iostream>
  11. #include <boost/phoenix/version.hpp>
  12. // Some other things may be needed here...
  13. // Include all proto for the time being...
  14. #include <boost/proto/proto.hpp>
  15. namespace boost { namespace phoenix
  16. {
  17. // For now just drop through to the Proto versions.
  18. /// \brief Pretty-print a Phoenix expression tree using the Proto code.
  19. ///
  20. /// \note Equivalent to <tt>functional::display_expr(0, sout)(expr)</tt>
  21. /// \param expr The Phoenix expression tree to pretty-print
  22. /// \param sout The \c ostream to which the output should be
  23. /// written. If not specified, defaults to
  24. /// <tt>std::cout</tt>.
  25. template<typename Expr>
  26. void display_expr(Expr const &expr, std::ostream &sout)
  27. {
  28. boost::proto::display_expr(expr,sout);
  29. }
  30. /// \overload
  31. ///
  32. template<typename Expr>
  33. void display_expr(Expr const &expr)
  34. {
  35. boost::proto::display_expr(expr);
  36. }
  37. } // namespace phoenix
  38. } // namespace boost
  39. #endif