🎨 replace alternative operators (and, not, or)

This commit is contained in:
Niels Lohmann 2020-06-03 14:20:36 +02:00
parent 4f04ea1bef
commit 0498202a03
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
22 changed files with 1300 additions and 1300 deletions

View file

@ -423,7 +423,7 @@ class iter_impl
*/
bool operator!=(const iter_impl& other) const
{
return not operator==(other);
return !operator==(other);
}
/*!
@ -459,7 +459,7 @@ class iter_impl
*/
bool operator<=(const iter_impl& other) const
{
return not other.operator < (*this);
return !other.operator < (*this);
}
/*!
@ -468,7 +468,7 @@ class iter_impl
*/
bool operator>(const iter_impl& other) const
{
return not operator<=(other);
return !operator<=(other);
}
/*!
@ -477,7 +477,7 @@ class iter_impl
*/
bool operator>=(const iter_impl& other) const
{
return not operator<(other);
return !operator<(other);
}
/*!

View file

@ -17,7 +17,7 @@ void int_to_string( string_type& target, std::size_t value )
{
target = std::to_string(value);
}
template <typename IteratorType> class iteration_proxy_value
template<typename IteratorType> class iteration_proxy_value
{
public:
using difference_type = std::ptrdiff_t;
@ -131,7 +131,7 @@ template<typename IteratorType> class iteration_proxy
// Structured Bindings Support
// For further reference see https://blog.tartanllama.xyz/structured-bindings/
// And see https://github.com/nlohmann/json/pull/1391
template <std::size_t N, typename IteratorType, enable_if_t<N == 0, int> = 0>
template<std::size_t N, typename IteratorType, enable_if_t<N == 0, int> = 0>
auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>& i) -> decltype(i.key())
{
return i.key();
@ -139,7 +139,7 @@ auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>& i) -> decl
// Structured Bindings Support
// For further reference see https://blog.tartanllama.xyz/structured-bindings/
// And see https://github.com/nlohmann/json/pull/1391
template <std::size_t N, typename IteratorType, enable_if_t<N == 1, int> = 0>
template<std::size_t N, typename IteratorType, enable_if_t<N == 1, int> = 0>
auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>& i) -> decltype(i.value())
{
return i.value();
@ -158,11 +158,11 @@ namespace std
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmismatched-tags"
#endif
template <typename IteratorType>
template<typename IteratorType>
class tuple_size<::nlohmann::detail::iteration_proxy_value<IteratorType>>
: public std::integral_constant<std::size_t, 2> {};
template <std::size_t N, typename IteratorType>
template<std::size_t N, typename IteratorType>
class tuple_element<N, ::nlohmann::detail::iteration_proxy_value<IteratorType >>
{
public:

View file

@ -9,10 +9,10 @@ namespace nlohmann
{
namespace detail
{
template <typename It, typename = void>
template<typename It, typename = void>
struct iterator_types {};
template <typename It>
template<typename It>
struct iterator_types <
It,
void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
@ -27,18 +27,18 @@ struct iterator_types <
// This is required as some compilers implement std::iterator_traits in a way that
// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341.
template <typename T, typename = void>
template<typename T, typename = void>
struct iterator_traits
{
};
template <typename T>
template<typename T>
struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
: iterator_types<T>
{
};
template <typename T>
template<typename T>
struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
{
using iterator_category = std::random_access_iterator_tag;