From patchwork Thu May 21 00:00:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1294839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=qqRnEsVp; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49S8sT2DmPz9sTS for ; Thu, 21 May 2020 10:00:59 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D8BC6396EC7F; Thu, 21 May 2020 00:00:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8BC6396EC7F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590019257; bh=osWMfZbh5OqtixmTlpFBCpXBOleCPGfF5ObbWb5XJ1U=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qqRnEsVphuFvV6Iey5w6acRWs8JKLH8rWpx0U+9qGdK9HQ17BNmbrebw/CNI7839R G6sBOAFwIEGY/b/sN8N2LQMuiBKNFCmCWqtlQ7gun6gbxtwBrDsChJeaVx/GlGfD7q cLgvJSgAUmg7IjlPAMyYubWzfLd4ilFn9fR/DMBY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id EAF2C386F829 for ; Thu, 21 May 2020 00:00:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EAF2C386F829 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-lc0I77I7NIykzL3YKQkQ2g-1; Wed, 20 May 2020 20:00:50 -0400 X-MC-Unique: lc0I77I7NIykzL3YKQkQ2g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34A098015D2; Thu, 21 May 2020 00:00:49 +0000 (UTC) Received: from localhost (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id A08DC5D9CA; Thu, 21 May 2020 00:00:48 +0000 (UTC) Date: Thu, 21 May 2020 01:00:47 +0100 To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Use 'using' for types in Networking TS headers Message-ID: <20200521000047.GA1915341@redhat.com> MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-18.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" * include/experimental/buffer: Replace typedefs with alias-declarations. * include/experimental/executor: Likewise. * include/experimental/internet: Likewise. * include/experimental/socket: Likewise. * include/experimental/timer: Likewise. Tested powerpc64le-linux, committed to master. commit f26e72d8310c3e70f7a4b345e06a9c5c8d51728a Author: Jonathan Wakely Date: Thu May 21 00:59:55 2020 +0100 libstdc++: Use 'using' for types in Networking TS headers * include/experimental/buffer: Replace typedefs with alias-declarations. * include/experimental/executor: Likewise. * include/experimental/internet: Likewise. * include/experimental/socket: Likewise. * include/experimental/timer: Likewise. diff --git a/libstdc++-v3/include/experimental/buffer b/libstdc++-v3/include/experimental/buffer index 0b04b71286c..8ccdb28cc5b 100644 --- a/libstdc++-v3/include/experimental/buffer +++ b/libstdc++-v3/include/experimental/buffer @@ -488,8 +488,8 @@ inline namespace v1 { 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 diff --git a/libstdc++-v3/include/experimental/executor b/libstdc++-v3/include/experimental/executor index 3560e345e8a..f55414c9360 100644 --- a/libstdc++-v3/include/experimental/executor +++ b/libstdc++-v3/include/experimental/executor @@ -369,8 +369,8 @@ inline namespace v1 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; @@ -660,8 +660,8 @@ inline namespace v1 public: // types: - typedef _Tp target_type; - typedef _Executor executor_type; + using target_type = _Tp; + using executor_type = _Executor; // construct / copy / destroy: @@ -766,7 +766,7 @@ inline namespace v1 template struct associated_allocator, _ProtoAlloc> { - typedef associated_allocator_t<_Tp, _ProtoAlloc> type; + using type = associated_allocator_t<_Tp, _ProtoAlloc>; static type get(const executor_binder<_Tp, _Executor>& __b, @@ -777,7 +777,7 @@ inline namespace v1 template struct associated_executor, _Executor1> { - typedef _Executor type; + using type = _Executor; static type get(const executor_binder<_Tp, _Executor>& __b, @@ -791,7 +791,7 @@ inline namespace v1 public: // types: - typedef _Executor executor_type; + using executor_type = _Executor; // construct / copy / destroy: @@ -845,7 +845,7 @@ inline namespace v1 public: // types: - typedef system_executor executor_type; + using executor_type = system_executor; // construct / copy / destroy: @@ -1446,7 +1446,7 @@ inline namespace v1 public: // types: - typedef _Executor inner_executor_type; + using inner_executor_type = _Executor; // construct / copy / destroy: diff --git a/libstdc++-v3/include/experimental/internet b/libstdc++-v3/include/experimental/internet index 1aa81095009..71e40d83a7e 100644 --- a/libstdc++-v3/include/experimental/internet +++ b/libstdc++-v3/include/experimental/internet @@ -110,8 +110,8 @@ namespace ip /// @} #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 @@ -133,7 +133,7 @@ namespace ip { public: // types: - typedef uint_least32_t uint_type; + using uint_type = uint_least32_t; struct bytes_type : array { @@ -918,11 +918,11 @@ namespace ip { 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 @@ -972,17 +972,17 @@ namespace ip address_v4 _M_address; }; - typedef basic_address_iterator address_v4_iterator; + using address_v4_iterator = basic_address_iterator; template<> class basic_address_iterator { 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 @@ -1026,7 +1026,7 @@ namespace ip address_v6 _M_address; }; - typedef basic_address_iterator address_v6_iterator; + using address_v6_iterator = basic_address_iterator; template class basic_address_range; // not defined @@ -1039,7 +1039,7 @@ namespace ip public: // types: - typedef basic_address_iterator iterator; + using iterator = basic_address_iterator; // constructors: @@ -1071,7 +1071,7 @@ namespace ip iterator _M_end; }; - typedef basic_address_range address_v4_range; + using address_v4_range = basic_address_range; // @} @@ -1084,7 +1084,7 @@ namespace ip public: // types: - typedef basic_address_iterator iterator; + using iterator = basic_address_iterator; // constructors: @@ -1112,7 +1112,7 @@ namespace ip iterator _M_end; }; - typedef basic_address_range address_v6_range; + using address_v6_range = basic_address_range; // @} @@ -1384,7 +1384,7 @@ namespace ip { public: // types: - typedef _InternetProtocol protocol_type; + using protocol_type = _InternetProtocol; // constructors: @@ -1574,8 +1574,8 @@ namespace ip { 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() { } @@ -1697,15 +1697,15 @@ namespace ip { public: // types: - typedef _InternetProtocol protocol_type; - typedef typename protocol_type::endpoint endpoint_type; - typedef basic_resolver_entry value_type; - typedef const value_type& const_reference; - typedef value_type& reference; - typedef typename forward_list::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; + using const_reference = const value_type&; + using reference = value_type&; + using const_iterator = typename forward_list::const_iterator; + using iterator = const_iterator; + using difference_type = ptrdiff_t; + using size_type = size_t; // construct / copy / destroy: @@ -1775,10 +1775,10 @@ namespace ip 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: @@ -2056,11 +2056,11 @@ namespace ip { public: // types: - typedef basic_endpoint endpoint; ///< A TCP endpoint. - typedef basic_resolver resolver; ///< A TCP resolver. - typedef basic_stream_socket socket; ///< A TCP socket. - typedef basic_socket_acceptor acceptor; ///< A TCP acceptor. - typedef basic_socket_iostream iostream; /// A TCP iostream. + using endpoint = basic_endpoint; ///< A TCP endpoint. + using resolver = basic_resolver; ///< A TCP resolver. + using socket = basic_stream_socket; ///< A TCP socket. + using acceptor = basic_socket_acceptor; ///< A TCP acceptor. + using iostream = basic_socket_iostream; /// A TCP iostream. #ifdef _GLIBCXX_HAVE_NETINET_TCP_H /// Disable coalescing of small segments (i.e. the Nagle algorithm). @@ -2111,9 +2111,9 @@ namespace ip { public: // types: - typedef basic_endpoint endpoint; - typedef basic_resolver resolver; - typedef basic_datagram_socket socket; + using endpoint = basic_endpoint; + using resolver = basic_resolver; + using socket = basic_datagram_socket; // static members: static constexpr udp v4() noexcept { return udp(AF_INET); } diff --git a/libstdc++-v3/include/experimental/socket b/libstdc++-v3/include/experimental/socket index 81b1d15b654..837965cb3c0 100644 --- a/libstdc++-v3/include/experimental/socket +++ b/libstdc++-v3/include/experimental/socket @@ -701,10 +701,10 @@ inline namespace v1 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: @@ -1067,9 +1067,9 @@ inline namespace v1 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: @@ -1520,9 +1520,9 @@ inline namespace v1 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: @@ -1833,11 +1833,11 @@ inline namespace v1 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: @@ -2277,12 +2277,12 @@ inline namespace v1 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: @@ -2355,12 +2355,12 @@ inline namespace v1 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: diff --git a/libstdc++-v3/include/experimental/timer b/libstdc++-v3/include/experimental/timer index d50ca76c2df..58249d0387d 100644 --- a/libstdc++-v3/include/experimental/timer +++ b/libstdc++-v3/include/experimental/timer @@ -81,11 +81,11 @@ inline namespace v1 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: @@ -170,10 +170,10 @@ inline namespace v1 friend class io_context; }; - typedef basic_waitable_timer system_timer; - typedef basic_waitable_timer steady_timer; - typedef basic_waitable_timer - high_resolution_timer; + using system_timer = basic_waitable_timer; + using steady_timer = basic_waitable_timer; + using high_resolution_timer + = basic_waitable_timer; template void