✨ added overload for std::less<value_t> #486
MSVC needs this overload to compile code containing a std::map that uses nlohmann::detail::operator as key.
This commit is contained in:
parent
758c4addc1
commit
f4126e4dd8
3 changed files with 39 additions and 0 deletions
16
src/json.hpp
16
src/json.hpp
|
@ -13025,6 +13025,22 @@ struct hash<nlohmann::json>
|
|||
return h(j.dump());
|
||||
}
|
||||
};
|
||||
|
||||
/// specialization for std::less<value_t>
|
||||
template <>
|
||||
struct less<::nlohmann::detail::value_t>
|
||||
{
|
||||
/*!
|
||||
@brief compare two value_t enum values
|
||||
@since version 3.0.0
|
||||
*/
|
||||
bool operator()(nlohmann::detail::value_t lhs,
|
||||
nlohmann::detail::value_t rhs) const noexcept
|
||||
{
|
||||
return nlohmann::detail::operator<(lhs, rhs);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
|
||||
/*!
|
||||
|
|
|
@ -12059,6 +12059,22 @@ struct hash<nlohmann::json>
|
|||
return h(j.dump());
|
||||
}
|
||||
};
|
||||
|
||||
/// specialization for std::less<value_t>
|
||||
template <>
|
||||
struct less<::nlohmann::detail::value_t>
|
||||
{
|
||||
/*!
|
||||
@brief compare two value_t enum values
|
||||
@since version 3.0.0
|
||||
*/
|
||||
bool operator()(nlohmann::detail::value_t lhs,
|
||||
nlohmann::detail::value_t rhs) const noexcept
|
||||
{
|
||||
return nlohmann::detail::operator<(lhs, rhs);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue