🔨 approach to un-break the changes for #462
This commit is contained in:
parent
22b59693f1
commit
aba8b58492
3 changed files with 21 additions and 2 deletions
19
src/json.hpp
19
src/json.hpp
|
@ -13182,6 +13182,15 @@ class basic_json
|
||||||
return binary_reader(i).parse_cbor(strict);
|
return binary_reader(i).parse_cbor(strict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
@copydoc from_cbor(detail::input_adapter, const bool)
|
||||||
|
*/
|
||||||
|
template<typename A1, typename A2,
|
||||||
|
detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0>
|
||||||
|
static basic_json from_cbor(A1&& a1, A2&& a2, const bool strict = true)
|
||||||
|
{
|
||||||
|
return binary_reader(detail::input_adapter(std::forward<A1>(a1), std::forward<A2>(a2))).parse_cbor(strict);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@brief create a JSON value from an input in MessagePack format
|
@brief create a JSON value from an input in MessagePack format
|
||||||
|
@ -13260,6 +13269,16 @@ class basic_json
|
||||||
return binary_reader(i).parse_msgpack(strict);
|
return binary_reader(i).parse_msgpack(strict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
@copydoc from_msgpack(detail::input_adapter, const bool)
|
||||||
|
*/
|
||||||
|
template<typename A1, typename A2,
|
||||||
|
detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0>
|
||||||
|
static basic_json from_msgpack(A1&& a1, A2&& a2, const bool strict = true)
|
||||||
|
{
|
||||||
|
return binary_reader(detail::input_adapter(std::forward<A1>(a1), std::forward<A2>(a2))).parse_msgpack(strict);
|
||||||
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
|
|
@ -1322,7 +1322,7 @@ TEST_CASE("single CBOR roundtrip")
|
||||||
|
|
||||||
// check with different start index
|
// check with different start index
|
||||||
packed.insert(packed.begin(), 5, 0xff);
|
packed.insert(packed.begin(), 5, 0xff);
|
||||||
CHECK(j1 == json::from_cbor({packed.begin() + 5, packed.end()}));
|
CHECK(j1 == json::from_cbor(packed.begin() + 5, packed.end()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1164,7 +1164,7 @@ TEST_CASE("single MessagePack roundtrip")
|
||||||
|
|
||||||
// check with different start index
|
// check with different start index
|
||||||
packed.insert(packed.begin(), 5, 0xff);
|
packed.insert(packed.begin(), 5, 0xff);
|
||||||
CHECK(j1 == json::from_msgpack({packed.begin() + 5, packed.end()}));
|
CHECK(j1 == json::from_msgpack(packed.begin() + 5, packed.end()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue