mirror of
https://github.com/nlohmann/json.git
synced 2025-07-31 10:24:23 +03:00
make to_json SFINAE-correct
This commit is contained in:
@ -35,9 +35,11 @@ struct adl_serializer
|
||||
@param[in,out] j JSON value to write to
|
||||
@param[in] val value to read from
|
||||
*/
|
||||
template<typename BasicJsonType, typename ValueType>
|
||||
static void to_json(BasicJsonType& j, ValueType&& val) noexcept(
|
||||
template <typename BasicJsonType, typename ValueType>
|
||||
static auto to_json(BasicJsonType& j, ValueType&& val) noexcept(
|
||||
noexcept(::nlohmann::to_json(j, std::forward<ValueType>(val))))
|
||||
-> decltype(::nlohmann::to_json(j, std::forward<ValueType>(val)),
|
||||
void())
|
||||
{
|
||||
::nlohmann::to_json(j, std::forward<ValueType>(val));
|
||||
}
|
||||
|
Reference in New Issue
Block a user