File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 14
14
#include < string>
15
15
#include < vector>
16
16
17
- namespace nlohmann ::detail {
18
- template <> struct char_traits <std::byte> : char_traits<std::underlying_type_t <std::byte>> {
19
- using char_type = std::byte;
20
-
21
- // Redefine to_int_type function
22
- static int_type to_int_type (char_type c) noexcept { return static_cast <int_type>(c); }
23
- };
24
- } // namespace nlohmann::detail
25
17
namespace power_grid_model_cpp {
26
18
namespace {
27
19
using namespace std ::string_literals;
@@ -89,7 +81,9 @@ TEST_CASE("API Serialization and Deserialization") {
89
81
SUBCASE (" Round trip" ) {
90
82
std::vector<std::byte> msgpack_data{};
91
83
msgpack_serializer.get_to_binary_buffer (0 , msgpack_data);
92
- auto const json_document = nlohmann::ordered_json::from_msgpack (msgpack_data);
84
+ auto const char_start = reinterpret_cast <unsigned char const *>(msgpack_data.data ());
85
+ auto const char_end = char_start + msgpack_data.size ();
86
+ auto const json_document = nlohmann::ordered_json::from_msgpack (char_start, char_end);
93
87
auto const json_result = json_document.dump (-1 );
94
88
CHECK (json_result == json_data);
95
89
}
You can’t perform that action at this time.
0 commit comments