diff --git a/include/nlohmann/detail/output/binary_writer.hpp b/include/nlohmann/detail/output/binary_writer.hpp index 842640503..c682e72dc 100644 --- a/include/nlohmann/detail/output/binary_writer.hpp +++ b/include/nlohmann/detail/output/binary_writer.hpp @@ -9,6 +9,7 @@ #include // numeric_limits #include // string #include // move +#include // vector #include #include @@ -900,7 +901,7 @@ class binary_writer return ubjson_prefix(v, use_bjdata) == first_prefix; }); - if (same_prefix && !(use_bjdata && std::string("[{SHTFNZ").find(first_prefix) != std::string::npos)) + if (same_prefix && !(use_bjdata && std::string("[{SHTFNZ").find(static_cast(first_prefix)) != std::string::npos)) { prefix_required = false; oa->write_character(to_char_type('$')); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 5b8d054c6..974653623 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -13765,6 +13765,7 @@ class json_ref #include // numeric_limits #include // string #include // move +#include // vector // #include @@ -14799,7 +14800,7 @@ class binary_writer return ubjson_prefix(v, use_bjdata) == first_prefix; }); - if (same_prefix && !(use_bjdata && std::string("[{SHTFNZ").find(first_prefix) != std::string::npos)) + if (same_prefix && !(use_bjdata && std::string("[{SHTFNZ").find(static_cast(first_prefix)) != std::string::npos)) { prefix_required = false; oa->write_character(to_char_type('$'));