/usr/include/boost/metaparse/v1
Edit: /usr/include/boost/metaparse/v1/keyword.hpp (2307B)
#ifndef BOOST_METAPARSE_V1_KEYWORD_HPP
#define BOOST_METAPARSE_V1_KEYWORD_HPP
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010.
// 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)
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost
{
namespace metaparse
{
namespace v1
{
// Does not consume/check anything after the keyword
template
struct keyword
{
private:
struct nonempty
{
private:
typedef lit::type> next_char_parser;
typedef
keyword::type, ResultType>
rest_parser;
template
struct apply_unchecked :
rest_parser::template apply<
typename get_remaining<
typename next_char_parser::template apply
>::type,
typename get_position<
typename next_char_parser::template apply
>::type
>
{};
public:
template
struct apply :
boost::mpl::eval_if<
typename is_error<
typename next_char_parser::template apply
>::type,
typename next_char_parser::template apply,
apply_unchecked
>
{};
};
public:
typedef keyword type;
template
struct apply :
boost::mpl::if_<
boost::mpl::empty,
return_,
nonempty
>::type::template apply
{};
};
}
}
}
#endif