Added BOOST_OVERRIDE according to -Wsuggest-override

This commit is contained in:
Ion Gaztañaga
2021-12-27 01:01:10 +01:00
parent f8988cb155
commit 40735223d5
7 changed files with 21 additions and 21 deletions
@@ -160,18 +160,18 @@ class BOOST_CONTAINER_DECL monotonic_buffer_resource
//! then allocate the return block from the newly-allocated internal `current_buffer`.
//!
//! <b>Throws</b>: Nothing unless `upstream_resource()->allocate()` throws.
void* do_allocate(std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
virtual void* do_allocate(std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
//! <b>Effects</b>: None
//!
//! <b>Throws</b>: Nothing
//!
//! <b>Remarks</b>: Memory used by this resource increases monotonically until its destruction.
void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) BOOST_NOEXCEPT BOOST_OVERRIDE;
virtual void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) BOOST_NOEXCEPT BOOST_OVERRIDE;
//! <b>Returns</b>:
//! `this == dynamic_cast<const monotonic_buffer_resource*>(&other)`.
bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT BOOST_OVERRIDE;
virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT BOOST_OVERRIDE;
};
} //namespace pmr {
@@ -144,7 +144,7 @@ class resource_adaptor_imp
protected:
//! <b>Returns</b>: Allocated memory obtained by calling m_alloc.allocate. The size and alignment
//! of the allocated memory shall meet the requirements for a class derived from memory_resource.
virtual void* do_allocate(std::size_t bytes, std::size_t alignment)
virtual void* do_allocate(std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE
{
if (alignment <= priv_guaranteed_allocator_alignment())
return this->ebo_alloc_t::get().allocate(bytes);
@@ -156,7 +156,7 @@ class resource_adaptor_imp
//! subsequently deallocated.
//!
//! <b>Effects</b>: Returns memory to the allocator using m_alloc.deallocate().
virtual void do_deallocate(void* p, std::size_t bytes, std::size_t alignment)
virtual void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE
{
if (alignment <= priv_guaranteed_allocator_alignment())
this->ebo_alloc_t::get().deallocate((char*)p, bytes);
@@ -167,7 +167,7 @@ class resource_adaptor_imp
//! Let p be dynamic_cast<const resource_adaptor_imp*>(&other).
//!
//! <b>Returns</b>: false if p is null, otherwise the value of m_alloc == p->m_alloc.
virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT
virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT BOOST_OVERRIDE
{
const resource_adaptor_imp* p = dynamic_cast<const resource_adaptor_imp*>(&other);
return p && p->ebo_alloc_t::get() == this->ebo_alloc_t::get();
@@ -103,13 +103,13 @@ class BOOST_CONTAINER_DECL synchronized_pool_resource
protected:
//! @copydoc ::boost::container::pmr::unsynchronized_pool_resource::do_allocate()
void* do_allocate(std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
virtual void* do_allocate(std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
//! @copydoc ::boost::container::pmr::unsynchronized_pool_resource::do_deallocate(void*,std::size_t,std::size_t)
void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
virtual void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
//! @copydoc ::boost::container::pmr::unsynchronized_pool_resource::do_is_equal(const memory_resource&)const
bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT BOOST_OVERRIDE;
virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT BOOST_OVERRIDE;
//Non-standard observers
public:
@@ -134,18 +134,18 @@ class BOOST_CONTAINER_DECL unsynchronized_pool_resource
//! using `upstream_resource()->allocate()`.
//!
//! <b>Throws</b>: Nothing unless `upstream_resource()->allocate()` throws.
void* do_allocate(std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
virtual void* do_allocate(std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
//! <b>Effects</b>: Return the memory at p to the pool. It is unspecified if or under
//! what circumstances this operation will result in a call to
//! `upstream_resource()->deallocate()`.
//!
//! <b>Throws</b>: Nothing.
void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
virtual void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) BOOST_OVERRIDE;
//! <b>Returns</b>:
//! `this == dynamic_cast<const unsynchronized_pool_resource*>(&other)`.
bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT BOOST_OVERRIDE;
virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT BOOST_OVERRIDE;
//Non-standard observers
public:
+1 -1
View File
@@ -59,7 +59,7 @@ class BOOST_SYMBOL_VISIBLE exception
: std_exception_t(), m_msg(msg)
{}
virtual const char *what() const BOOST_NOEXCEPT_OR_NOTHROW
virtual const char *what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE
{ return m_msg ? m_msg : "unknown boost::container exception"; }
private: