Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C++11 override qualifiers to overridden virtual member functions #1469

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions asio/include/asio/basic_streambuf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class basic_streambuf
/**
* Behaves according to the specification of @c std::streambuf::underflow().
*/
int_type underflow()
int_type underflow() override
{
if (gptr() < pptr())
{
Expand All @@ -280,7 +280,7 @@ class basic_streambuf
* the character to the input sequence would require the condition
* <tt>size() > max_size()</tt> to be true.
*/
int_type overflow(int_type c)
int_type overflow(int_type c) override
{
if (!traits_type::eq_int_type(c, traits_type::eof()))
{
Expand Down
4 changes: 2 additions & 2 deletions asio/include/asio/cancellation_signal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class cancellation_handler
{
}

void call(cancellation_type_t type)
void call(cancellation_type_t type) override
{
handler_(type);
}

std::pair<void*, std::size_t> destroy() noexcept
std::pair<void*, std::size_t> destroy() noexcept override
{
std::pair<void*, std::size_t> mem(this, size_);
this->cancellation_handler::~cancellation_handler();
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/deadline_timer_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class deadline_timer_service
}

// Destroy all user-defined handler objects owned by the service.
void shutdown()
void shutdown() override
{
}

Expand Down
8 changes: 4 additions & 4 deletions asio/include/asio/detail/epoll_reactor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ class epoll_reactor
ASIO_DECL ~epoll_reactor();

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Recreate internal descriptors following a fork.
ASIO_DECL void notify_fork(
asio::execution_context::fork_event fork_ev);
asio::execution_context::fork_event fork_ev) override;

// Initialise the task.
ASIO_DECL void init_task();
Expand Down Expand Up @@ -206,10 +206,10 @@ class epoll_reactor
typename timer_queue<Time_Traits>::per_timer_data& source);

// Run epoll once until interrupted or events are ready to be dispatched.
ASIO_DECL void run(long usec, op_queue<operation>& ops);
ASIO_DECL void run(long usec, op_queue<operation>& ops) override;

// Interrupt the select loop.
ASIO_DECL void interrupt();
ASIO_DECL void interrupt() override;

private:
// The hint to pass to epoll_create to size its data structures.
Expand Down
6 changes: 3 additions & 3 deletions asio/include/asio/detail/null_reactor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ class null_reactor
}

// Destroy all user-defined handler objects owned by the service.
void shutdown()
void shutdown() override
{
}

// No-op because should never be called.
void run(long /*usec*/, op_queue<scheduler_operation>& /*ops*/)
void run(long /*usec*/, op_queue<scheduler_operation>& /*ops*/) override
{
}

// No-op.
void interrupt()
void interrupt() override
{
}
};
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/posix_serial_port_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class posix_serial_port_service :
ASIO_DECL posix_serial_port_service(execution_context& context);

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Construct a new serial port implementation.
void construct(implementation_type& impl)
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/posix_thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class posix_thread
{
}

virtual void run()
virtual void run() override
{
f_();
}
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/reactive_descriptor_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class reactive_descriptor_service :
ASIO_DECL reactive_descriptor_service(execution_context& context);

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Construct a new descriptor implementation.
ASIO_DECL void construct(implementation_type& impl);
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/reactive_socket_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class reactive_socket_service :
}

// Destroy all user-defined handler objects owned by the service.
void shutdown()
void shutdown() override
{
this->base_shutdown();
}
Expand Down
4 changes: 2 additions & 2 deletions asio/include/asio/detail/resolver_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ class resolver_service :
}

// Destroy all user-defined handler objects owned by the service.
void shutdown()
void shutdown() override
{
this->base_shutdown();
}

// Perform any fork-related housekeeping.
void notify_fork(execution_context::fork_event fork_ev)
void notify_fork(execution_context::fork_event fork_ev) override
{
this->base_notify_fork(fork_ev);
}
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class scheduler
ASIO_DECL ~scheduler();

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Initialise the task, if required.
ASIO_DECL void init_task();
Expand Down
4 changes: 2 additions & 2 deletions asio/include/asio/detail/select_reactor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ class select_reactor
ASIO_DECL ~select_reactor();

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Recreate internal descriptors following a fork.
ASIO_DECL void notify_fork(
asio::execution_context::fork_event fork_ev);
asio::execution_context::fork_event fork_ev) override;

// Initialise the task, but only if the reactor is not in its own thread.
ASIO_DECL void init_task();
Expand Down
4 changes: 2 additions & 2 deletions asio/include/asio/detail/signal_set_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ class signal_set_service :
ASIO_DECL ~signal_set_service();

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Perform fork-related housekeeping.
ASIO_DECL void notify_fork(
asio::execution_context::fork_event fork_ev);
asio::execution_context::fork_event fork_ev) override;

// Construct a new signal_set implementation.
ASIO_DECL void construct(implementation_type& impl);
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/strand_executor_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class strand_executor_service
ASIO_DECL explicit strand_executor_service(execution_context& context);

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Create a new strand_executor implementation.
ASIO_DECL implementation_type create_implementation();
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/strand_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class strand_service
ASIO_DECL explicit strand_service(asio::io_context& io_context);

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Construct a new strand implementation.
ASIO_DECL void construct(implementation_type& impl);
Expand Down
10 changes: 5 additions & 5 deletions asio/include/asio/detail/timer_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ class timer_queue
}

// Whether there are no timers in the queue.
virtual bool empty() const
virtual bool empty() const override
{
return timers_ == 0;
}

// Get the time for the timer that is earliest in the queue.
virtual long wait_duration_msec(long max_duration) const
virtual long wait_duration_msec(long max_duration) const override
{
if (heap_.empty())
return max_duration;
Expand All @@ -130,7 +130,7 @@ class timer_queue
}

// Get the time for the timer that is earliest in the queue.
virtual long wait_duration_usec(long max_duration) const
virtual long wait_duration_usec(long max_duration) const override
{
if (heap_.empty())
return max_duration;
Expand All @@ -142,7 +142,7 @@ class timer_queue
}

// Dequeue all timers not later than the current time.
virtual void get_ready_timers(op_queue<operation>& ops)
virtual void get_ready_timers(op_queue<operation>& ops) override
{
if (!heap_.empty())
{
Expand All @@ -162,7 +162,7 @@ class timer_queue
}

// Dequeue all timers.
virtual void get_all_timers(op_queue<operation>& ops)
virtual void get_all_timers(op_queue<operation>& ops) override
{
while (timers_)
{
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/win_iocp_file_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class win_iocp_file_service :
ASIO_DECL win_iocp_file_service(execution_context& context);

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Construct a new file implementation.
void construct(implementation_type& impl)
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/win_iocp_handle_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class win_iocp_handle_service :
ASIO_DECL win_iocp_handle_service(execution_context& context);

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Construct a new handle implementation.
ASIO_DECL void construct(implementation_type& impl);
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/win_iocp_io_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class win_iocp_io_context
ASIO_DECL ~win_iocp_io_context();

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Initialise the task. Nothing to do here.
void init_task()
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/win_iocp_serial_port_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class win_iocp_serial_port_service :
ASIO_DECL win_iocp_serial_port_service(execution_context& context);

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Construct a new serial port implementation.
void construct(implementation_type& impl)
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/win_iocp_socket_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class win_iocp_socket_service :
}

// Destroy all user-defined handler objects owned by the service.
void shutdown()
void shutdown() override
{
this->base_shutdown();
}
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/win_object_handle_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class win_object_handle_service :
ASIO_DECL win_object_handle_service(execution_context& context);

// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown();
ASIO_DECL void shutdown() override;

// Construct a new handle implementation.
ASIO_DECL void construct(implementation_type& impl);
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/execution/bad_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class bad_executor
ASIO_DECL bad_executor() noexcept;

/// Obtain message associated with exception.
ASIO_DECL virtual const char* what() const noexcept;
ASIO_DECL virtual const char* what() const noexcept override;
};

} // namespace execution
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class bad_executor

/// Obtain message associated with exception.
ASIO_DECL virtual const char* what() const
noexcept;
noexcept override;
};

/// Polymorphic wrapper for executors.
Expand Down
12 changes: 6 additions & 6 deletions asio/include/asio/impl/error.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ namespace detail {
class netdb_category : public asio::error_category
{
public:
const char* name() const noexcept
const char* name() const noexcept override
{
return "asio.netdb";
}

std::string message(int value) const
std::string message(int value) const override
{
if (value == error::host_not_found)
return "Host not found (authoritative)";
Expand All @@ -63,12 +63,12 @@ namespace detail {
class addrinfo_category : public asio::error_category
{
public:
const char* name() const noexcept
const char* name() const noexcept override
{
return "asio.addrinfo";
}

std::string message(int value) const
std::string message(int value) const override
{
if (value == error::service_not_found)
return "Service not found";
Expand All @@ -93,12 +93,12 @@ namespace detail {
class misc_category : public asio::error_category
{
public:
const char* name() const noexcept
const char* name() const noexcept override
{
return "asio.misc";
}

std::string message(int value) const
std::string message(int value) const override
{
if (value == error::already_open)
return "Already open";
Expand Down
4 changes: 2 additions & 2 deletions asio/include/asio/impl/error_code.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ namespace detail {
class system_category : public error_category
{
public:
const char* name() const noexcept
const char* name() const noexcept override
{
return "asio.system";
}

std::string message(int value) const
std::string message(int value) const override
{
#if defined(ASIO_WINDOWS_RUNTIME) || defined(ASIO_WINDOWS_APP)
std::wstring wmsg(128, wchar_t());
Expand Down
Loading