1 // Copyright (c) 2001-2011 Hartmut Kaiser
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #if !defined(BOOST_SPIRIT_WHAT_MAY_04_2007_0116PM)
7 #define BOOST_SPIRIT_WHAT_MAY_04_2007_0116PM
13 #include <boost/mpl/assert.hpp>
14 #include <boost/spirit/home/support/info.hpp>
15 #include <boost/spirit/home/karma/meta_compiler.hpp>
17 namespace boost { namespace spirit { namespace karma
19 template <typename Expr>
20 inline info what(Expr const& xpr)
22 // Report invalid expression error as early as possible.
23 // If you got an error_invalid_expression
24 // error message here, then the expression (expr) is not a
25 // valid spirit karma expression.
26 BOOST_SPIRIT_ASSERT_MATCH(karma::domain, Expr);
27 return compile<karma::domain>(xpr).what(unused);