diff options
Diffstat (limited to '3rdparty/asio/include/asio/ip/detail/endpoint.hpp')
-rw-r--r-- | 3rdparty/asio/include/asio/ip/detail/endpoint.hpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/3rdparty/asio/include/asio/ip/detail/endpoint.hpp b/3rdparty/asio/include/asio/ip/detail/endpoint.hpp index 82875a4440c..a19fa48e17f 100644 --- a/3rdparty/asio/include/asio/ip/detail/endpoint.hpp +++ b/3rdparty/asio/include/asio/ip/detail/endpoint.hpp @@ -2,7 +2,7 @@ // ip/detail/endpoint.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -33,42 +33,43 @@ class endpoint { public: // Default constructor. - ASIO_DECL endpoint(); + ASIO_DECL endpoint() ASIO_NOEXCEPT; // Construct an endpoint using a family and port number. - ASIO_DECL endpoint(int family, unsigned short port_num); + ASIO_DECL endpoint(int family, + unsigned short port_num) ASIO_NOEXCEPT; // Construct an endpoint using an address and port number. ASIO_DECL endpoint(const asio::ip::address& addr, - unsigned short port_num); + unsigned short port_num) ASIO_NOEXCEPT; // Copy constructor. - endpoint(const endpoint& other) + endpoint(const endpoint& other) ASIO_NOEXCEPT : data_(other.data_) { } // Assign from another endpoint. - endpoint& operator=(const endpoint& other) + endpoint& operator=(const endpoint& other) ASIO_NOEXCEPT { data_ = other.data_; return *this; } // Get the underlying endpoint in the native type. - asio::detail::socket_addr_type* data() + asio::detail::socket_addr_type* data() ASIO_NOEXCEPT { return &data_.base; } // Get the underlying endpoint in the native type. - const asio::detail::socket_addr_type* data() const + const asio::detail::socket_addr_type* data() const ASIO_NOEXCEPT { return &data_.base; } // Get the underlying size of the endpoint in the native type. - std::size_t size() const + std::size_t size() const ASIO_NOEXCEPT { if (is_v4()) return sizeof(asio::detail::sockaddr_in4_type); @@ -80,33 +81,34 @@ public: ASIO_DECL void resize(std::size_t new_size); // Get the capacity of the endpoint in the native type. - std::size_t capacity() const + std::size_t capacity() const ASIO_NOEXCEPT { return sizeof(data_); } // Get the port associated with the endpoint. - ASIO_DECL unsigned short port() const; + ASIO_DECL unsigned short port() const ASIO_NOEXCEPT; // Set the port associated with the endpoint. - ASIO_DECL void port(unsigned short port_num); + ASIO_DECL void port(unsigned short port_num) ASIO_NOEXCEPT; // Get the IP address associated with the endpoint. - ASIO_DECL asio::ip::address address() const; + ASIO_DECL asio::ip::address address() const ASIO_NOEXCEPT; // Set the IP address associated with the endpoint. - ASIO_DECL void address(const asio::ip::address& addr); + ASIO_DECL void address( + const asio::ip::address& addr) ASIO_NOEXCEPT; // Compare two endpoints for equality. - ASIO_DECL friend bool operator==( - const endpoint& e1, const endpoint& e2); + ASIO_DECL friend bool operator==(const endpoint& e1, + const endpoint& e2) ASIO_NOEXCEPT; // Compare endpoints for ordering. - ASIO_DECL friend bool operator<( - const endpoint& e1, const endpoint& e2); + ASIO_DECL friend bool operator<(const endpoint& e1, + const endpoint& e2) ASIO_NOEXCEPT; // Determine whether the endpoint is IPv4. - bool is_v4() const + bool is_v4() const ASIO_NOEXCEPT { return data_.base.sa_family == ASIO_OS_DEF(AF_INET); } |