69 lines
1.3 KiB
Plaintext
69 lines
1.3 KiB
Plaintext
[#get_remaining]
|
|
[section get_remaining]
|
|
|
|
[h1 Synopsis]
|
|
|
|
template <class D>
|
|
struct get_remaining;
|
|
|
|
This is a [link lazy_metafunction lazy template metafunction].
|
|
|
|
[table Arguments
|
|
[[Name] [Type]]
|
|
[[`D`] [[link accept accept] value]]
|
|
]
|
|
|
|
[h1 Description]
|
|
|
|
Returns the remaining string information of a parsing result.
|
|
|
|
[h1 Header]
|
|
|
|
#include <boost/metaparse/get_remaining.hpp>
|
|
|
|
[h1 Example]
|
|
|
|
#include <boost/metaparse/get_remaining.hpp>
|
|
#include <boost/metaparse/start.hpp>
|
|
#include <boost/metaparse/accept.hpp>
|
|
#include <boost/metaparse/string.hpp>
|
|
|
|
#include <type_traits>
|
|
|
|
using namespace boost::metaparse;
|
|
|
|
struct returns_accept
|
|
{
|
|
using type =
|
|
accept<
|
|
std::integral_constant<int, 13>,
|
|
BOOST_METAPARSE_STRING("foo"),
|
|
start
|
|
>;
|
|
};
|
|
|
|
static_assert(
|
|
std::is_same<
|
|
BOOST_METAPARSE_STRING("foo"),
|
|
get_remaining<
|
|
accept<
|
|
std::integral_constant<int, 13>,
|
|
BOOST_METAPARSE_STRING("foo"),
|
|
start
|
|
>
|
|
>::type
|
|
>::type::value,
|
|
"It should return the remaining input"
|
|
);
|
|
|
|
static_assert(
|
|
std::is_same<
|
|
BOOST_METAPARSE_STRING("foo"),
|
|
get_remaining<returns_accept>::type
|
|
>::type::value,
|
|
"It should support lazy evaluation"
|
|
);
|
|
|
|
[endsect]
|
|
|