diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index d1c7fea11..01bec749b 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -119,7 +119,7 @@ template class wide_string_input_adapter : public input_adapter_protocol { public: - wide_string_input_adapter(const WideStringType& w) : str(w) {} + explicit wide_string_input_adapter(const WideStringType& w) : str(w) {} std::char_traits::int_type get_character() noexcept override { diff --git a/include/nlohmann/detail/iterators/json_reverse_iterator.hpp b/include/nlohmann/detail/iterators/json_reverse_iterator.hpp index 06448191e..11f2a30ac 100644 --- a/include/nlohmann/detail/iterators/json_reverse_iterator.hpp +++ b/include/nlohmann/detail/iterators/json_reverse_iterator.hpp @@ -41,11 +41,11 @@ class json_reverse_iterator : public std::reverse_iterator using reference = typename Base::reference; /// create reverse iterator from iterator - json_reverse_iterator(const typename base_iterator::iterator_type& it) noexcept + explicit json_reverse_iterator(const typename base_iterator::iterator_type& it) noexcept : base_iterator(it) {} /// create reverse iterator from base class - json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} + explicit json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} /// post-increment (it++) json_reverse_iterator const operator++(int) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 21c37d7db..4c9f4cd90 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -1733,7 +1733,7 @@ template class wide_string_input_adapter : public input_adapter_protocol { public: - wide_string_input_adapter(const WideStringType& w) : str(w) {} + explicit wide_string_input_adapter(const WideStringType& w) : str(w) {} std::char_traits::int_type get_character() noexcept override { @@ -4593,7 +4593,7 @@ class primitive_iterator_t primitive_iterator_t const operator++(int) noexcept { auto result = *this; - m_it++; + ++m_it; return result; } @@ -4606,7 +4606,7 @@ class primitive_iterator_t primitive_iterator_t const operator--(int) noexcept { auto result = *this; - m_it--; + --m_it; return result; } @@ -5433,11 +5433,11 @@ class json_reverse_iterator : public std::reverse_iterator using reference = typename Base::reference; /// create reverse iterator from iterator - json_reverse_iterator(const typename base_iterator::iterator_type& it) noexcept + explicit json_reverse_iterator(const typename base_iterator::iterator_type& it) noexcept : base_iterator(it) {} /// create reverse iterator from base class - json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} + explicit json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} /// post-increment (it++) json_reverse_iterator const operator++(int)