clean up

parent f359d74e
...@@ -12,7 +12,6 @@ const_iterator erase(const_iterator first, const_iterator last); ...@@ -12,7 +12,6 @@ const_iterator erase(const_iterator first, const_iterator last);
// (3) // (3)
template<typename KeyT> template<typename KeyT>
size_type erase(KeyT && key); size_type erase(KeyT && key);
size_type erase(const std::string_view& key); // since C++17
// (4) // (4)
void erase(const size_type idx); void erase(const size_type idx);
...@@ -36,7 +35,7 @@ void erase(const size_type idx); ...@@ -36,7 +35,7 @@ void erase(const size_type idx);
## Template parameters ## Template parameters
`KeyT` `KeyT`
: A type convertible to an object key. This can also be a string literal. : A type convertible to an object key. This can also be a string literal or a string view (C++17).
## Parameters ## Parameters
...@@ -182,4 +181,4 @@ Strong exception safety: if an exception occurs, the original value stays intact ...@@ -182,4 +181,4 @@ Strong exception safety: if an exception occurs, the original value stays intact
- Added in version 1.0.0. - Added in version 1.0.0.
- Added support for binary types in version 3.8.0. - Added support for binary types in version 3.8.0.
- Added `KeyT` template and overload for `std::string_view` in version 3.10.0. - Added `KeyT` template in version 3.10.0.
...@@ -394,5 +394,17 @@ struct is_constructible_tuple : std::false_type {}; ...@@ -394,5 +394,17 @@ struct is_constructible_tuple : std::false_type {};
template<typename T1, typename... Args> template<typename T1, typename... Args>
struct is_constructible_tuple<T1, std::tuple<Args...>> : conjunction<std::is_constructible<T1, Args>...> {}; struct is_constructible_tuple<T1, std::tuple<Args...>> : conjunction<std::is_constructible<T1, Args>...> {};
/// type to check if KeyType can be used as object key
template<typename BasicJsonType, typename KeyType>
struct is_key_type
{
static constexpr bool value =
#if defined(JSON_HAS_CPP_17)
std::is_same<typename std::decay<KeyType>::type, std::string_view>::value ||
#endif
std::is_convertible<KeyType, typename BasicJsonType::object_t::key_type>::value;
};
} // namespace detail } // namespace detail
} // namespace nlohmann } // namespace nlohmann
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment