BSON: Hopefully fixing ambiguity (on some compilers) to call to string::find()

This commit is contained in:
Julian Becker 2018-10-17 21:47:01 +02:00
parent 2a63869159
commit 8de10c518b
2 changed files with 2 additions and 2 deletions

View file

@ -683,7 +683,7 @@ class binary_writer
*/ */
static std::size_t calc_bson_entry_header_size(const typename BasicJsonType::string_t& name) static std::size_t calc_bson_entry_header_size(const typename BasicJsonType::string_t& name)
{ {
if (name.find(static_cast<CharType>(0)) != BasicJsonType::string_t::npos) if (name.find(static_cast<typename BasicJsonType::string_t::value_type>(0)) != BasicJsonType::string_t::npos)
{ {
JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000")); JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000"));
} }

View file

@ -8840,7 +8840,7 @@ class binary_writer
*/ */
static std::size_t calc_bson_entry_header_size(const typename BasicJsonType::string_t& name) static std::size_t calc_bson_entry_header_size(const typename BasicJsonType::string_t& name)
{ {
if (name.find(static_cast<CharType>(0)) != BasicJsonType::string_t::npos) if (name.find(static_cast<typename BasicJsonType::string_t::value_type>(0)) != BasicJsonType::string_t::npos)
{ {
JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000")); JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000"));
} }