2
0
mirror of https://github.com/boostorg/url.git synced 2026-02-14 01:02:17 +00:00

Add range type trait

This commit is contained in:
Vinnie Falco
2021-09-15 11:43:24 -07:00
parent 399ccb3739
commit e4f8bc87ce
2 changed files with 16 additions and 8 deletions

View File

@@ -20,6 +20,9 @@
namespace boost {
namespace urls {
struct pct_encoded_str;
namespace bnf {
/** Alias for `std::true_type` if T satisfies __Range__
@@ -33,20 +36,24 @@ struct is_range : std::false_type {};
template<class T>
struct is_range<T, boost::void_t<
decltype(typename T::value_type()), // default ctor
decltype(
//typename T::value_type,
std::declval<char const*&>() =
std::declval<bool&>() =
T::begin(
std::declval<char const*&>(),
std::declval<char const*>(),
std::declval<error_code&>(),
std::declval<typename T::value_type &>()),
std::declval<char const*&>() =
std::declval<typename
std::add_lvalue_reference<
typename T::value_type>::type>()),
std::declval<bool&>() =
T::increment(
std::declval<char const*&>(),
std::declval<char const*>(),
std::declval<error_code&>(),
std::declval<typename T::value_type &>())
std::declval<typename
std::add_lvalue_reference<
typename T::value_type>::type>())
) > >
: std::true_type
{

View File

@@ -84,7 +84,8 @@ struct segment_nz_nc_bnf
// path-abempty = *( "/" segment )
struct path_abempty_bnf
{
using value_type = pct_encoded_str;
using value_type =
pct_encoded_str;
parsed_path& v;
@@ -93,7 +94,7 @@ struct path_abempty_bnf
bool
begin(
char const*& it,
char const* const end,
char const* end,
error_code& ec,
pct_encoded_str& t) noexcept;
@@ -102,7 +103,7 @@ struct path_abempty_bnf
bool
increment(
char const*& it,
char const* const end,
char const* end,
error_code& ec,
pct_encoded_str& t) noexcept;