1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-24 02:21:01 +03:00

🚑 fix for #486

Implemented std::less<value_t> to allow using value_t as std::map key
in MSVC.
This commit is contained in:
Niels Lohmann
2017-03-12 10:40:36 +01:00
3 changed files with 39 additions and 0 deletions

View File

@ -13048,6 +13048,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
/*!