*: add "noexcept" to many, many function prototypes

This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
This commit is contained in:
Max Kellermann
2017-05-08 14:44:49 +02:00
parent ac2e4e593d
commit 71f0ed8b74
272 changed files with 873 additions and 846 deletions

View File

@@ -103,16 +103,16 @@ public:
using SocketMonitor::Close;
gcc_pure
std::string ToString() const {
std::string ToString() const noexcept {
return ::ToString(address);
}
void SetFD(int _fd) {
void SetFD(int _fd) noexcept {
SocketMonitor::Open(_fd);
SocketMonitor::ScheduleRead();
}
void Accept();
void Accept() noexcept;
private:
virtual bool OnSocketReady(unsigned flags) override;
@@ -146,7 +146,7 @@ get_remote_uid(int fd)
}
inline void
OneServerSocket::Accept()
OneServerSocket::Accept() noexcept
{
StaticSocketAddress peer_address;
size_t peer_address_length = sizeof(peer_address);
@@ -343,7 +343,7 @@ ServerSocket::AddPortIPv6(unsigned port)
*/
gcc_pure
static bool
SupportsIPv6()
SupportsIPv6() noexcept
{
int fd = socket(AF_INET6, SOCK_STREAM, 0);
if (fd < 0)