*: add lost of "noexcept" specifications
This commit is contained in:
@@ -76,47 +76,47 @@ public:
|
||||
|
||||
AllocatedSocketAddress &operator=(const AllocatedSocketAddress &) = delete;
|
||||
|
||||
AllocatedSocketAddress &operator=(AllocatedSocketAddress &&src) {
|
||||
AllocatedSocketAddress &operator=(AllocatedSocketAddress &&src) noexcept {
|
||||
std::swap(address, src.address);
|
||||
std::swap(size, src.size);
|
||||
return *this;
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
bool operator==(SocketAddress other) const {
|
||||
bool operator==(SocketAddress other) const noexcept {
|
||||
return (SocketAddress)*this == other;
|
||||
}
|
||||
|
||||
bool operator!=(SocketAddress &other) const {
|
||||
bool operator!=(SocketAddress &other) const noexcept {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
gcc_const
|
||||
static AllocatedSocketAddress Null() {
|
||||
static AllocatedSocketAddress Null() noexcept {
|
||||
return AllocatedSocketAddress(nullptr, 0);
|
||||
}
|
||||
|
||||
bool IsNull() const {
|
||||
bool IsNull() const noexcept {
|
||||
return address == nullptr;
|
||||
}
|
||||
|
||||
size_type GetSize() const {
|
||||
size_type GetSize() const noexcept {
|
||||
return size;
|
||||
}
|
||||
|
||||
const struct sockaddr *GetAddress() const {
|
||||
const struct sockaddr *GetAddress() const noexcept {
|
||||
return address;
|
||||
}
|
||||
|
||||
operator SocketAddress() const {
|
||||
operator SocketAddress() const noexcept {
|
||||
return SocketAddress(address, size);
|
||||
}
|
||||
|
||||
operator const struct sockaddr *() const {
|
||||
operator const struct sockaddr *() const noexcept {
|
||||
return address;
|
||||
}
|
||||
|
||||
int GetFamily() const {
|
||||
int GetFamily() const noexcept {
|
||||
return address->sa_family;
|
||||
}
|
||||
|
||||
@@ -124,11 +124,11 @@ public:
|
||||
* Does the object have a well-defined address? Check !IsNull()
|
||||
* before calling this method.
|
||||
*/
|
||||
bool IsDefined() const {
|
||||
bool IsDefined() const noexcept {
|
||||
return GetFamily() != AF_UNSPEC;
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
void Clear() noexcept {
|
||||
free(address);
|
||||
address = nullptr;
|
||||
size = 0;
|
||||
|
@@ -51,52 +51,52 @@ public:
|
||||
|
||||
StaticSocketAddress &operator=(SocketAddress other) noexcept;
|
||||
|
||||
operator SocketAddress() const {
|
||||
operator SocketAddress() const noexcept {
|
||||
return SocketAddress(reinterpret_cast<const struct sockaddr *>(&address),
|
||||
size);
|
||||
}
|
||||
|
||||
struct sockaddr *GetAddress() {
|
||||
struct sockaddr *GetAddress() noexcept {
|
||||
return reinterpret_cast<struct sockaddr *>(&address);
|
||||
}
|
||||
|
||||
const struct sockaddr *GetAddress() const {
|
||||
const struct sockaddr *GetAddress() const noexcept {
|
||||
return reinterpret_cast<const struct sockaddr *>(&address);
|
||||
}
|
||||
|
||||
constexpr size_type GetCapacity() const {
|
||||
constexpr size_type GetCapacity() const noexcept {
|
||||
return sizeof(address);
|
||||
}
|
||||
|
||||
size_type GetSize() const {
|
||||
size_type GetSize() const noexcept {
|
||||
return size;
|
||||
}
|
||||
|
||||
void SetSize(size_type _size) {
|
||||
void SetSize(size_type _size) noexcept {
|
||||
assert(_size > 0);
|
||||
assert(size_t(_size) <= sizeof(address));
|
||||
|
||||
size = _size;
|
||||
}
|
||||
|
||||
int GetFamily() const {
|
||||
int GetFamily() const noexcept {
|
||||
return address.ss_family;
|
||||
}
|
||||
|
||||
bool IsDefined() const {
|
||||
bool IsDefined() const noexcept {
|
||||
return GetFamily() != AF_UNSPEC;
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
void Clear() noexcept {
|
||||
address.ss_family = AF_UNSPEC;
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
bool operator==(SocketAddress other) const {
|
||||
bool operator==(SocketAddress other) const noexcept {
|
||||
return (SocketAddress)*this == other;
|
||||
}
|
||||
|
||||
bool operator!=(SocketAddress &other) const {
|
||||
bool operator!=(SocketAddress &other) const noexcept {
|
||||
return !(*this == other);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user