From c1d9e88402cf2755502df4db6de9e9a127f49edb Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 7 Jan 2024 13:08:17 -0800 Subject: [PATCH] Remove unnecessary final and apply clang-format --- include/fmt/core.h | 25 ++++++++++++------------- include/fmt/format.h | 3 +-- include/fmt/ranges.h | 3 +-- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 1c70d264..c2920e16 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -22,10 +22,12 @@ # define FMT_BEGIN_NAMESPACE_CXX11 # define FMT_END_NAMESPACE_CXX11 #elif defined(_GLIBCXX_RELEASE) -# define FMT_BEGIN_NAMESPACE_STD \ +# define FMT_BEGIN_NAMESPACE_STD \ namespace std _GLIBCXX_VISIBILITY(default) { \ _GLIBCXX_BEGIN_NAMESPACE_VERSION -# define FMT_END_NAMESPACE_STD _GLIBCXX_END_NAMESPACE_VERSION } +# define FMT_END_NAMESPACE_STD \ + _GLIBCXX_END_NAMESPACE_VERSION \ + } # define FMT_STD_TEMPLATE_VIS # if defined(_GLIBCXX_USE_CXX11_ABI) # define FMT_BEGIN_NAMESPACE_CXX11 inline _GLIBCXX_BEGIN_NAMESPACE_CXX11 @@ -37,10 +39,8 @@ #ifdef FMT_BEGIN_NAMESPACE_STD FMT_BEGIN_NAMESPACE_STD -template -struct FMT_STD_TEMPLATE_VIS char_traits; -template -class FMT_STD_TEMPLATE_VIS allocator; +template struct FMT_STD_TEMPLATE_VIS char_traits; +template class FMT_STD_TEMPLATE_VIS allocator; FMT_BEGIN_NAMESPACE_CXX11 template class FMT_STD_TEMPLATE_VIS basic_string; @@ -940,7 +940,7 @@ class fixed_buffer_traits { // A buffer that writes to an output iterator when flushed. template -class iterator_buffer final : public Traits, public buffer { +class iterator_buffer : public Traits, public buffer { private: OutputIt out_; enum { buffer_size = 256 }; @@ -975,9 +975,8 @@ class iterator_buffer final : public Traits, public buffer { }; template -class iterator_buffer final - : public fixed_buffer_traits, - public buffer { +class iterator_buffer : public fixed_buffer_traits, + public buffer { private: T* out_; enum { buffer_size = 256 }; @@ -1020,7 +1019,7 @@ class iterator_buffer final } }; -template class iterator_buffer final : public buffer { +template class iterator_buffer : public buffer { public: explicit iterator_buffer(T* out, size_t = 0) : buffer([](buffer&, size_t) {}, out, 0, ~size_t()) {} @@ -1033,7 +1032,7 @@ template class iterator_buffer, enable_if_t::value, typename Container::value_type>> - final : public buffer { + : public buffer { private: using value_type = typename Container::value_type; Container& container_; @@ -1056,7 +1055,7 @@ class iterator_buffer, }; // A buffer that counts the number of code units written discarding the output. -template class counting_buffer final : public buffer { +template class counting_buffer : public buffer { private: enum { buffer_size = 256 }; T data_[buffer_size]; diff --git a/include/fmt/format.h b/include/fmt/format.h index 1bac0ee8..e5acae9c 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -932,7 +932,7 @@ enum { inline_buffer_size = 500 }; */ template > -class basic_memory_buffer final : public detail::buffer { +class basic_memory_buffer : public detail::buffer { private: T store_[SIZE]; @@ -945,7 +945,6 @@ class basic_memory_buffer final : public detail::buffer { if (data != store_) alloc_.deallocate(data, this->capacity()); } - protected: static FMT_CONSTEXPR20 void grow(detail::buffer& buf, size_t size) { detail::abort_fuzzing_if(size > 5000); auto& self = static_cast(buf); diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 034049e0..75666d1c 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -360,8 +360,7 @@ struct formatter struct is_range { static constexpr const bool value = - detail::is_range_::value && - !detail::has_to_string_view::value && + detail::is_range_::value && !detail::has_to_string_view::value && !std::is_convertible>::value && !std::is_convertible>::value; };