mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-31 19:24:48 +02:00
Remove unnecessary final and apply clang-format
This commit is contained in:
@@ -22,10 +22,12 @@
|
|||||||
# define FMT_BEGIN_NAMESPACE_CXX11
|
# define FMT_BEGIN_NAMESPACE_CXX11
|
||||||
# define FMT_END_NAMESPACE_CXX11
|
# define FMT_END_NAMESPACE_CXX11
|
||||||
#elif defined(_GLIBCXX_RELEASE)
|
#elif defined(_GLIBCXX_RELEASE)
|
||||||
# define FMT_BEGIN_NAMESPACE_STD \
|
# define FMT_BEGIN_NAMESPACE_STD \
|
||||||
namespace std _GLIBCXX_VISIBILITY(default) { \
|
namespace std _GLIBCXX_VISIBILITY(default) { \
|
||||||
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
_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
|
# define FMT_STD_TEMPLATE_VIS
|
||||||
# if defined(_GLIBCXX_USE_CXX11_ABI)
|
# if defined(_GLIBCXX_USE_CXX11_ABI)
|
||||||
# define FMT_BEGIN_NAMESPACE_CXX11 inline _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
# define FMT_BEGIN_NAMESPACE_CXX11 inline _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
@@ -37,10 +39,8 @@
|
|||||||
|
|
||||||
#ifdef FMT_BEGIN_NAMESPACE_STD
|
#ifdef FMT_BEGIN_NAMESPACE_STD
|
||||||
FMT_BEGIN_NAMESPACE_STD
|
FMT_BEGIN_NAMESPACE_STD
|
||||||
template <typename Char>
|
template <typename Char> struct FMT_STD_TEMPLATE_VIS char_traits;
|
||||||
struct FMT_STD_TEMPLATE_VIS char_traits;
|
template <typename T> class FMT_STD_TEMPLATE_VIS allocator;
|
||||||
template <typename T>
|
|
||||||
class FMT_STD_TEMPLATE_VIS allocator;
|
|
||||||
FMT_BEGIN_NAMESPACE_CXX11
|
FMT_BEGIN_NAMESPACE_CXX11
|
||||||
template <typename Char, typename Traits, typename Allocator>
|
template <typename Char, typename Traits, typename Allocator>
|
||||||
class FMT_STD_TEMPLATE_VIS basic_string;
|
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.
|
// A buffer that writes to an output iterator when flushed.
|
||||||
template <typename OutputIt, typename T, typename Traits = buffer_traits>
|
template <typename OutputIt, typename T, typename Traits = buffer_traits>
|
||||||
class iterator_buffer final : public Traits, public buffer<T> {
|
class iterator_buffer : public Traits, public buffer<T> {
|
||||||
private:
|
private:
|
||||||
OutputIt out_;
|
OutputIt out_;
|
||||||
enum { buffer_size = 256 };
|
enum { buffer_size = 256 };
|
||||||
@@ -975,9 +975,8 @@ class iterator_buffer final : public Traits, public buffer<T> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class iterator_buffer<T*, T, fixed_buffer_traits> final
|
class iterator_buffer<T*, T, fixed_buffer_traits> : public fixed_buffer_traits,
|
||||||
: public fixed_buffer_traits,
|
public buffer<T> {
|
||||||
public buffer<T> {
|
|
||||||
private:
|
private:
|
||||||
T* out_;
|
T* out_;
|
||||||
enum { buffer_size = 256 };
|
enum { buffer_size = 256 };
|
||||||
@@ -1020,7 +1019,7 @@ class iterator_buffer<T*, T, fixed_buffer_traits> final
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T> class iterator_buffer<T*, T> final : public buffer<T> {
|
template <typename T> class iterator_buffer<T*, T> : public buffer<T> {
|
||||||
public:
|
public:
|
||||||
explicit iterator_buffer(T* out, size_t = 0)
|
explicit iterator_buffer(T* out, size_t = 0)
|
||||||
: buffer<T>([](buffer<T>&, size_t) {}, out, 0, ~size_t()) {}
|
: buffer<T>([](buffer<T>&, size_t) {}, out, 0, ~size_t()) {}
|
||||||
@@ -1033,7 +1032,7 @@ template <typename Container>
|
|||||||
class iterator_buffer<back_insert_iterator<Container>,
|
class iterator_buffer<back_insert_iterator<Container>,
|
||||||
enable_if_t<is_contiguous<Container>::value,
|
enable_if_t<is_contiguous<Container>::value,
|
||||||
typename Container::value_type>>
|
typename Container::value_type>>
|
||||||
final : public buffer<typename Container::value_type> {
|
: public buffer<typename Container::value_type> {
|
||||||
private:
|
private:
|
||||||
using value_type = typename Container::value_type;
|
using value_type = typename Container::value_type;
|
||||||
Container& container_;
|
Container& container_;
|
||||||
@@ -1056,7 +1055,7 @@ class iterator_buffer<back_insert_iterator<Container>,
|
|||||||
};
|
};
|
||||||
|
|
||||||
// A buffer that counts the number of code units written discarding the output.
|
// A buffer that counts the number of code units written discarding the output.
|
||||||
template <typename T = char> class counting_buffer final : public buffer<T> {
|
template <typename T = char> class counting_buffer : public buffer<T> {
|
||||||
private:
|
private:
|
||||||
enum { buffer_size = 256 };
|
enum { buffer_size = 256 };
|
||||||
T data_[buffer_size];
|
T data_[buffer_size];
|
||||||
|
@@ -932,7 +932,7 @@ enum { inline_buffer_size = 500 };
|
|||||||
*/
|
*/
|
||||||
template <typename T, size_t SIZE = inline_buffer_size,
|
template <typename T, size_t SIZE = inline_buffer_size,
|
||||||
typename Allocator = std::allocator<T>>
|
typename Allocator = std::allocator<T>>
|
||||||
class basic_memory_buffer final : public detail::buffer<T> {
|
class basic_memory_buffer : public detail::buffer<T> {
|
||||||
private:
|
private:
|
||||||
T store_[SIZE];
|
T store_[SIZE];
|
||||||
|
|
||||||
@@ -945,7 +945,6 @@ class basic_memory_buffer final : public detail::buffer<T> {
|
|||||||
if (data != store_) alloc_.deallocate(data, this->capacity());
|
if (data != store_) alloc_.deallocate(data, this->capacity());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
static FMT_CONSTEXPR20 void grow(detail::buffer<T>& buf, size_t size) {
|
static FMT_CONSTEXPR20 void grow(detail::buffer<T>& buf, size_t size) {
|
||||||
detail::abort_fuzzing_if(size > 5000);
|
detail::abort_fuzzing_if(size > 5000);
|
||||||
auto& self = static_cast<basic_memory_buffer&>(buf);
|
auto& self = static_cast<basic_memory_buffer&>(buf);
|
||||||
|
@@ -360,8 +360,7 @@ struct formatter<Tuple, Char,
|
|||||||
|
|
||||||
template <typename T, typename Char> struct is_range {
|
template <typename T, typename Char> struct is_range {
|
||||||
static constexpr const bool value =
|
static constexpr const bool value =
|
||||||
detail::is_range_<T>::value &&
|
detail::is_range_<T>::value && !detail::has_to_string_view<T>::value &&
|
||||||
!detail::has_to_string_view<T>::value &&
|
|
||||||
!std::is_convertible<T, std::basic_string<Char>>::value &&
|
!std::is_convertible<T, std::basic_string<Char>>::value &&
|
||||||
!std::is_convertible<T, detail::std_string_view<Char>>::value;
|
!std::is_convertible<T, detail::std_string_view<Char>>::value;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user