Mercurial > hg > vamp-build-and-test
diff DEPENDENCIES/generic/include/boost/log/support/spirit_classic.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/log/support/spirit_classic.hpp Fri Sep 04 12:01:02 2015 +0100 +++ b/DEPENDENCIES/generic/include/boost/log/support/spirit_classic.hpp Mon Sep 07 11:12:49 2015 +0100 @@ -1,5 +1,5 @@ /* - * Copyright Andrey Semashev 2007 - 2013. + * Copyright Andrey Semashev 2007 - 2015. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -16,6 +16,7 @@ #define BOOST_LOG_SUPPORT_SPIRIT_CLASSIC_HPP_INCLUDED_ #include <boost/mpl/bool.hpp> +#include <boost/utility/enable_if.hpp> #include <boost/log/detail/config.hpp> #include <boost/log/utility/functional/matches.hpp> @@ -37,7 +38,11 @@ * in other translation units. The only reliable way to settle this problem is to * define the macro for the whole project (i.e. all translation units). */ -#warning Boost.Log: Boost.Spirit requires BOOST_SPIRIT_THREADSAFE macro to be defined if parsers are used in a multithreaded context. It is strongly recommended to define this macro project-wide. +#if defined(__GNUC__) +#pragma message "Boost.Log: Boost.Spirit requires BOOST_SPIRIT_THREADSAFE macro to be defined if parsers are used in a multithreaded context. It is strongly recommended to define this macro project-wide." +#elif defined(_MSC_VER) +#pragma message("Boost.Log: Boost.Spirit requires BOOST_SPIRIT_THREADSAFE macro to be defined if parsers are used in a multithreaded context. It is strongly recommended to define this macro project-wide.") +#endif #define BOOST_SPIRIT_THREADSAFE 1 #endif // !defined(BOOST_LOG_NO_THREADS) && !defined(BOOST_SPIRIT_THREADSAFE) @@ -51,9 +56,12 @@ namespace aux { +//! This tag type is used if an expression is recognized as a Boost.Spirit.Classic expression +struct boost_spirit_classic_expression_tag; + //! The trait verifies if the type can be converted to a Boost.Spirit (classic) parser template< typename T > -struct is_spirit_classic_parser< T, true > +struct is_spirit_classic_parser { private: typedef char yes_type; @@ -69,14 +77,22 @@ typedef mpl::bool_< value > type; }; -//! The matching functor implementation -template< > -struct matches_fun_impl< boost_spirit_classic_expression_tag > +//! The metafunction detects the matching expression kind and returns a tag that is used to specialize \c match_traits +template< typename ExpressionT > +struct matching_expression_kind< ExpressionT, typename boost::enable_if_c< is_spirit_classic_parser< ExpressionT >::value >::type > { - template< typename StringT, typename ParserT > - static bool matches( - StringT const& str, - ParserT const& expr) + typedef boost_spirit_classic_expression_tag type; +}; + +//! The matching function implementation +template< typename ExpressionT > +struct match_traits< ExpressionT, boost_spirit_classic_expression_tag > +{ + typedef ExpressionT compiled_type; + static compiled_type compile(ExpressionT const& expr) { return expr; } + + template< typename StringT > + static bool matches(StringT const& str, ExpressionT const& expr) { typedef typename StringT::const_iterator const_iterator; spirit::classic::parse_info< const_iterator > info =