Make classes derived from buffer<T> final to silence the virtual destructor warning. (#1937)

Co-authored-by: Bart Siwek <bsiwek@cisco.com>
This commit is contained in:
Bart SiwekandBart Siwek authored and GitHub committed 2020-10-15 17:41:56 -07:00
1 parent 811c8b58c5
commit 271eff149f
6 files changed
+11 -15

No files matched your search

+4 -4
View File
@@ -761,7 +761,7 @@ class fixed_buffer_traits {
// A buffer that writes to an output iterator when flushed.
template <typename OutputIt, typename T, typename Traits = buffer_traits>
class iterator_buffer : public Traits, public buffer<T> {
class iterator_buffer final : public Traits, public buffer<T> {
private:
OutputIt out_;
enum { buffer_size = 256 };
@@ -787,7 +787,7 @@ class iterator_buffer : public Traits, public buffer<T> {
size_t count() const { return Traits::count() + this->size(); }
};
template <typename T> class iterator_buffer<T*, T> : public buffer<T> {
template <typename T> class iterator_buffer<T*, T> final : public buffer<T> {
protected:
void grow(size_t) final FMT_OVERRIDE {}
@@ -801,7 +801,7 @@ template <typename T> class iterator_buffer<T*, T> : public buffer<T> {
template <typename Container>
class iterator_buffer<std::back_insert_iterator<Container>,
enable_if_t<is_contiguous<Container>::value,
typename Container::value_type>>
typename Container::value_type>> final
: public buffer<typename Container::value_type> {
private:
Container& container_;
@@ -823,7 +823,7 @@ class iterator_buffer<std::back_insert_iterator<Container>,
};
// A buffer that counts the number of code units written discarding the output.
template <typename T = char> class counting_buffer : public buffer<T> {
template <typename T = char> class counting_buffer final : public buffer<T> {
private:
enum { buffer_size = 256 };
T data_[buffer_size];