+2020-05-21 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/experimental/buffer: Replace typedefs with
+ alias-declarations.
+ * include/experimental/executor: Likewise.
+ * include/experimental/internet: Likewise.
+ * include/experimental/socket: Likewise.
+ * include/experimental/timer: Likewise.
+
2020-05-19 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/94087
{
public:
// types:
- typedef const_buffer const_buffers_type;
- typedef mutable_buffer mutable_buffers_type;
+ using const_buffers_type = const_buffer;
+ using mutable_buffers_type = mutable_buffer;
// constructors:
explicit
class async_result
{
public:
- typedef _CompletionToken completion_handler_type;
- typedef void return_type;
+ using completion_handler_type = _CompletionToken;
+ using return_type = void;
explicit async_result(completion_handler_type&) {}
async_result(const async_result&) = delete;
public:
// types:
- typedef _Tp target_type;
- typedef _Executor executor_type;
+ using target_type = _Tp;
+ using executor_type = _Executor;
// construct / copy / destroy:
template<typename _Tp, typename _Executor, typename _ProtoAlloc>
struct associated_allocator<executor_binder<_Tp, _Executor>, _ProtoAlloc>
{
- typedef associated_allocator_t<_Tp, _ProtoAlloc> type;
+ using type = associated_allocator_t<_Tp, _ProtoAlloc>;
static type
get(const executor_binder<_Tp, _Executor>& __b,
template<typename _Tp, typename _Executor, typename _Executor1>
struct associated_executor<executor_binder<_Tp, _Executor>, _Executor1>
{
- typedef _Executor type;
+ using type = _Executor;
static type
get(const executor_binder<_Tp, _Executor>& __b,
public:
// types:
- typedef _Executor executor_type;
+ using executor_type = _Executor;
// construct / copy / destroy:
public:
// types:
- typedef system_executor executor_type;
+ using executor_type = system_executor;
// construct / copy / destroy:
public:
// types:
- typedef _Executor inner_executor_type;
+ using inner_executor_type = _Executor;
// construct / copy / destroy:
/// @}
#endif
- typedef uint_least16_t port_type; ///< Type used for port numbers.
- typedef uint_least32_t scope_id_type; ///< Type used for IPv6 scope IDs.
+ using port_type = uint_least16_t; ///< Type used for port numbers.
+ using scope_id_type = uint_least32_t; ///< Type used for IPv6 scope IDs.
/// Convenience alias for constraining allocators for strings.
template<typename _Alloc>
{
public:
// types:
- typedef uint_least32_t uint_type;
+ using uint_type = uint_least32_t;
struct bytes_type : array<unsigned char, 4>
{
{
public:
// types:
- typedef address_v4 value_type;
- typedef ptrdiff_t difference_type;
- typedef const address_v4* pointer;
- typedef const address_v4& reference;
- typedef input_iterator_tag iterator_category;
+ using value_type = address_v4;
+ using difference_type = ptrdiff_t;
+ using pointer = const address_v4*;
+ using reference = const address_v4&;
+ using iterator_category = input_iterator_tag;
// constructors:
basic_address_iterator(const address_v4& __a) noexcept
address_v4 _M_address;
};
- typedef basic_address_iterator<address_v4> address_v4_iterator;
+ using address_v4_iterator = basic_address_iterator<address_v4>;
template<> class basic_address_iterator<address_v6>
{
public:
// types:
- typedef address_v6 value_type;
- typedef ptrdiff_t difference_type;
- typedef const address_v6* pointer;
- typedef const address_v6& reference;
- typedef input_iterator_tag iterator_category;
+ using value_type = address_v6;
+ using difference_type = ptrdiff_t;
+ using pointer = const address_v6*;
+ using reference = const address_v6&;
+ using iterator_category = input_iterator_tag;
// constructors:
basic_address_iterator(const address_v6& __a) noexcept
address_v6 _M_address;
};
- typedef basic_address_iterator<address_v6> address_v6_iterator;
+ using address_v6_iterator = basic_address_iterator<address_v6>;
template<typename> class basic_address_range; // not defined
public:
// types:
- typedef basic_address_iterator<address_v4> iterator;
+ using iterator = basic_address_iterator<address_v4>;
// constructors:
iterator _M_end;
};
- typedef basic_address_range<address_v4> address_v4_range;
+ using address_v4_range = basic_address_range<address_v4>;
// @}
public:
// types:
- typedef basic_address_iterator<address_v6> iterator;
+ using iterator = basic_address_iterator<address_v6>;
// constructors:
iterator _M_end;
};
- typedef basic_address_range<address_v6> address_v6_range;
+ using address_v6_range = basic_address_range<address_v6>;
// @}
{
public:
// types:
- typedef _InternetProtocol protocol_type;
+ using protocol_type = _InternetProtocol;
// constructors:
{
public:
// types:
- typedef _InternetProtocol protocol_type;
- typedef typename _InternetProtocol::endpoint endpoint_type;
+ using protocol_type = _InternetProtocol;
+ using endpoint_type = typename _InternetProtocol::endpoint;
// constructors:
basic_resolver_entry() { }
{
public:
// types:
- typedef _InternetProtocol protocol_type;
- typedef typename protocol_type::endpoint endpoint_type;
- typedef basic_resolver_entry<protocol_type> value_type;
- typedef const value_type& const_reference;
- typedef value_type& reference;
- typedef typename forward_list<value_type>::const_iterator const_iterator;
- typedef const_iterator iterator;
- typedef ptrdiff_t difference_type;
- typedef size_t size_type;
+ using protocol_type = _InternetProtocol;
+ using endpoint_type = typename protocol_type::endpoint;
+ using value_type = basic_resolver_entry<protocol_type>;
+ using const_reference = const value_type&;
+ using reference = value_type&;
+ using const_iterator = typename forward_list<value_type>::const_iterator;
+ using iterator = const_iterator;
+ using difference_type = ptrdiff_t;
+ using size_type = size_t;
// construct / copy / destroy:
public:
// types:
- typedef io_context::executor_type executor_type;
- typedef _InternetProtocol protocol_type;
- typedef typename _InternetProtocol::endpoint endpoint_type;
- typedef basic_resolver_results<_InternetProtocol> results_type;
+ using executor_type = io_context::executor_type;
+ using protocol_type = _InternetProtocol;
+ using endpoint_type = typename _InternetProtocol::endpoint;
+ using results_type = basic_resolver_results<_InternetProtocol>;
// construct / copy / destroy:
{
public:
// types:
- typedef basic_endpoint<tcp> endpoint; ///< A TCP endpoint.
- typedef basic_resolver<tcp> resolver; ///< A TCP resolver.
- typedef basic_stream_socket<tcp> socket; ///< A TCP socket.
- typedef basic_socket_acceptor<tcp> acceptor; ///< A TCP acceptor.
- typedef basic_socket_iostream<tcp> iostream; /// A TCP iostream.
+ using endpoint = basic_endpoint<tcp>; ///< A TCP endpoint.
+ using resolver = basic_resolver<tcp>; ///< A TCP resolver.
+ using socket = basic_stream_socket<tcp>; ///< A TCP socket.
+ using acceptor = basic_socket_acceptor<tcp>; ///< A TCP acceptor.
+ using iostream = basic_socket_iostream<tcp>; /// A TCP iostream.
#ifdef _GLIBCXX_HAVE_NETINET_TCP_H
/// Disable coalescing of small segments (i.e. the Nagle algorithm).
{
public:
// types:
- typedef basic_endpoint<udp> endpoint;
- typedef basic_resolver<udp> resolver;
- typedef basic_datagram_socket<udp> socket;
+ using endpoint = basic_endpoint<udp>;
+ using resolver = basic_resolver<udp>;
+ using socket = basic_datagram_socket<udp>;
// static members:
static constexpr udp v4() noexcept { return udp(AF_INET); }
public:
// types:
- typedef io_context::executor_type executor_type;
- typedef int native_handle_type;
- typedef _Protocol protocol_type;
- typedef typename protocol_type::endpoint endpoint_type;
+ using executor_type = io_context::executor_type;
+ using native_handle_type = int;
+ using protocol_type = _Protocol;
+ using endpoint_type = typename protocol_type::endpoint;
// basic_socket operations:
public:
// types:
- typedef int native_handle_type;
- typedef _Protocol protocol_type;
- typedef typename protocol_type::endpoint endpoint_type;
+ using native_handle_type = int;
+ using protocol_type = _Protocol;
+ using endpoint_type = typename protocol_type::endpoint;
// construct / copy / destroy:
public:
// types:
- typedef int native_handle_type;
- typedef _Protocol protocol_type;
- typedef typename protocol_type::endpoint endpoint_type;
+ using native_handle_type = int;
+ using protocol_type = _Protocol;
+ using endpoint_type = typename protocol_type::endpoint;
// construct / copy / destroy:
public:
// types:
- typedef io_context::executor_type executor_type;
- typedef int native_handle_type;
- typedef _AcceptableProtocol protocol_type;
- typedef typename protocol_type::endpoint endpoint_type;
- typedef typename protocol_type::socket socket_type;
+ using executor_type = io_context::executor_type;
+ using native_handle_type = int;
+ using protocol_type = _AcceptableProtocol;
+ using endpoint_type = typename protocol_type::endpoint;
+ using socket_type = typename protocol_type::socket;
// construct / copy / destroy:
public:
// types:
- typedef _Protocol protocol_type;
- typedef typename protocol_type::endpoint endpoint_type;
- typedef _Clock clock_type;
- typedef typename clock_type::time_point time_point;
- typedef typename clock_type::duration duration;
- typedef _WaitTraits wait_traits_type;
+ using protocol_type = _Protocol;
+ using endpoint_type = typename protocol_type::endpoint;
+ using clock_type = _Clock;
+ using time_point = typename clock_type::time_point;
+ using duration = typename clock_type::duration;
+ using wait_traits_type = _WaitTraits;
// construct / copy / destroy:
public:
// types:
- typedef _Protocol protocol_type;
- typedef typename protocol_type::endpoint endpoint_type;
- typedef _Clock clock_type;
- typedef typename clock_type::time_point time_point;
- typedef typename clock_type::duration duration;
- typedef _WaitTraits wait_traits_type;
+ using protocol_type = _Protocol;
+ using endpoint_type = typename protocol_type::endpoint;
+ using clock_type = _Clock;
+ using time_point = typename clock_type::time_point;
+ using duration = typename clock_type::duration;
+ using wait_traits_type = _WaitTraits;
// construct / copy / destroy:
public:
// types:
- typedef io_context::executor_type executor_type;
- typedef _Clock clock_type;
- typedef typename clock_type::duration duration;
- typedef typename clock_type::time_point time_point;
- typedef _WaitTraits traits_type;
+ using executor_type = io_context::executor_type;
+ using clock_type = _Clock;
+ using duration = typename clock_type::duration;
+ using time_point = typename clock_type::time_point;
+ using traits_type = _WaitTraits;
// construct / copy / destroy:
friend class io_context;
};
- typedef basic_waitable_timer<chrono::system_clock> system_timer;
- typedef basic_waitable_timer<chrono::steady_clock> steady_timer;
- typedef basic_waitable_timer<chrono::high_resolution_clock>
- high_resolution_timer;
+ using system_timer = basic_waitable_timer<chrono::system_clock>;
+ using steady_timer = basic_waitable_timer<chrono::steady_clock>;
+ using high_resolution_timer
+ = basic_waitable_timer<chrono::high_resolution_clock>;
template<typename _Clock, typename _WaitTraits>
void