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

View File

@ -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 {

View File

@ -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();

View File

@ -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:

View File

@ -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:

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:

View File

@ -21,10 +21,10 @@ class derived_from_memory_resource
: id(i)
{}
virtual ~derived_from_memory_resource()
virtual ~derived_from_memory_resource() BOOST_OVERRIDE
{ destructor_called = true; }
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
{
do_allocate_called = true;
do_allocate_bytes = bytes;
@ -32,7 +32,7 @@ class derived_from_memory_resource
return do_allocate_return;
}
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
{
do_deallocate_called = true;
do_deallocate_p = p;
@ -40,7 +40,7 @@ class derived_from_memory_resource
do_deallocate_alignment = alignment;
}
virtual bool do_is_equal(const boost::container::pmr::memory_resource& other) const BOOST_NOEXCEPT
virtual bool do_is_equal(const boost::container::pmr::memory_resource& other) const BOOST_NOEXCEPT BOOST_OVERRIDE
{
do_is_equal_called = true;
do_is_equal_other = &other;

View File

@ -35,10 +35,10 @@ class memory_resource_logger
, m_mismatches()
{}
virtual ~memory_resource_logger()
virtual ~memory_resource_logger() BOOST_OVERRIDE
{ this->reset(); }
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
{
char *addr =(char*)std::malloc(bytes);
if(!addr){
@ -52,7 +52,7 @@ class memory_resource_logger
return addr;
}
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
{
std::size_t i = 0, max = m_info.size();
while(i != max && m_info[i].address != p){
@ -69,7 +69,7 @@ class memory_resource_logger
}
}
virtual bool do_is_equal(const boost::container::pmr::memory_resource& other) const BOOST_NOEXCEPT
virtual bool do_is_equal(const boost::container::pmr::memory_resource& other) const BOOST_NOEXCEPT BOOST_OVERRIDE
{
return static_cast<const memory_resource *>(this) == &other;
}