}
explicit
- null_parser(parse_options po)
+ null_parser(parse_options po)
: p_(po)
{
}
bool
on_key_part(
string_view,
- std::size_t,
+ std::size_t,
error_code& ec)
{
return maybe_fail(ec);
bool
on_key(
string_view,
- std::size_t,
+ std::size_t,
error_code& ec)
{
return maybe_fail(ec);
}
-
+
bool
on_string_part(
string_view,
- std::size_t,
+ std::size_t,
error_code& ec)
{
return maybe_fail(ec);
bool
on_string(
string_view,
- std::size_t,
+ std::size_t,
error_code& ec)
{
return maybe_fail(ec);
return maybe_fail(ec);
}
- bool
+ bool
on_comment_part(
- string_view,
- error_code& ec)
- {
- return maybe_fail(ec);
+ string_view,
+ error_code& ec)
+ {
+ return maybe_fail(ec);
}
-
+
bool
on_comment(
- string_view,
- error_code& ec)
- {
+ string_view,
+ error_code& ec)
+ {
return maybe_fail(ec);
}
};
bool
on_key_part(
string_view,
- std::size_t,
+ std::size_t,
error_code&)
{
return maybe_throw();
bool
on_key(
string_view,
- std::size_t,
+ std::size_t,
error_code&)
{
return maybe_throw();
}
-
+
bool
on_string_part(
string_view,
- std::size_t,
+ std::size_t,
error_code&)
{
return maybe_throw();
bool
on_string(
string_view,
- std::size_t,
+ std::size_t,
error_code&)
{
return maybe_throw();
return maybe_throw();
}
- bool
+ bool
on_comment_part(
- string_view,
- error_code&)
- {
- return maybe_throw();
+ string_view,
+ error_code&)
+ {
+ return maybe_throw();
}
-
+
bool
on_comment(
- string_view,
- error_code&)
- {
+ string_view,
+ error_code&)
+ {
return maybe_throw();
}
};
return false;
}
+template<typename T>
+inline
+bool
+check_hash_equal(
+ T const& lhs,
+ T const& rhs)
+{
+ if(lhs == rhs){
+ return (std::hash<T>{}(lhs) == std::hash<T>{}(rhs));
+ }
+ return false; // ensure lhs == rhs intention
+}
+
+template<typename T, typename U>
+inline
+bool
+check_hash_equal(
+ T const& lhs,
+ U const& rhs)
+{
+ if(lhs == rhs){
+ return (std::hash<value>{}(lhs) == std::hash<value>{}(rhs));
+ }
+ return false; // ensure lhs == rhs intention
+}
+
+template<typename T>
+inline
+bool
+expect_hash_not_equal(
+ T const& lhs,
+ T const& rhs)
+{
+ if(std::hash<T>{}(lhs) != std::hash<T>{}(rhs)){
+ return lhs != rhs;
+ }
+ return true; // pass if hash values collide
+}
+
+template<typename T, typename U>
+inline
+bool
+expect_hash_not_equal(
+ T const& lhs,
+ U const& rhs)
+{
+ if(std::hash<value>{}(lhs) != std::hash<value>{}(rhs)){
+ return lhs != rhs;
+ }
+ return true; // pass if hash values collide
+}
//----------------------------------------------------------
namespace detail {