make to_json SFINAE-correct
This commit is contained in:
parent
f7c8a2145a
commit
f7971f04a5
3 changed files with 22 additions and 58 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue