From patchwork Mon May 16 18:23:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 95798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A75BAB6EE7 for ; Tue, 17 May 2011 04:25:05 +1000 (EST) Received: (qmail 17554 invoked by alias); 16 May 2011 18:25:02 -0000 Received: (qmail 17532 invoked by uid 22791); 16 May 2011 18:25:00 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp209.alice.it (HELO smtp209.alice.it) (82.57.200.105) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 May 2011 18:24:45 +0000 Received: from [192.168.1.4] (79.36.196.243) by smtp209.alice.it (8.5.124.08) id 4D498EF308EA69B7; Mon, 16 May 2011 20:24:44 +0200 Message-ID: <4DD16BBD.8040307@oracle.com> Date: Mon, 16 May 2011 20:23:57 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Thunderbird/3.1.10 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: Re: [v3] More noexcept bits, , std::pair, ... References: <4DD168A4.7070908@oracle.com> In-Reply-To: <4DD168A4.7070908@oracle.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Oops. Paolo. /////////////// 2011-05-16 Paolo Carlini * include/std/utility: Simplify the last commit, the whole std::get code is C++0x only. Index: include/std/utility =================================================================== --- include/std/utility (revision 173798) +++ include/std/utility (working copy) @@ -87,7 +87,7 @@ // Various functions which give std::pair a tuple-like interface. template - struct tuple_size > + struct tuple_size> { static const std::size_t value = 2; }; template @@ -95,11 +95,11 @@ tuple_size >::value; template - struct tuple_element<0, std::pair<_Tp1, _Tp2> > + struct tuple_element<0, std::pair<_Tp1, _Tp2>> { typedef _Tp1 type; }; template - struct tuple_element<1, std::pair<_Tp1, _Tp2> > + struct tuple_element<1, std::pair<_Tp1, _Tp2>> { typedef _Tp2 type; }; template @@ -110,19 +110,17 @@ { template static _Tp1& - __get(std::pair<_Tp1, _Tp2>& __pair) _GLIBCXX_NOEXCEPT + __get(std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.first; } -#ifdef __GXX_EXPERIMENTAL_CXX0X__ template static _Tp1&& __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<_Tp1>(__pair.first); } -#endif template static const _Tp1& - __const_get(const std::pair<_Tp1, _Tp2>& __pair) _GLIBCXX_NOEXCEPT + __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.first; } }; @@ -131,37 +129,33 @@ { template static _Tp2& - __get(std::pair<_Tp1, _Tp2>& __pair) _GLIBCXX_NOEXCEPT + __get(std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.second; } -#ifdef __GXX_EXPERIMENTAL_CXX0X__ template static _Tp2&& __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<_Tp2>(__pair.second); } -#endif template static const _Tp2& - __const_get(const std::pair<_Tp1, _Tp2>& __pair) _GLIBCXX_NOEXCEPT + __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.second; } }; template - inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& - get(std::pair<_Tp1, _Tp2>& __in) _GLIBCXX_NOEXCEPT + inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type& + get(std::pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__get(__in); } -#ifdef __GXX_EXPERIMENTAL_CXX0X__ template - inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& + inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&& get(std::pair<_Tp1, _Tp2>&& __in) noexcept { return __pair_get<_Int>::__move_get(std::move(__in)); } -#endif template - inline const typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& - get(const std::pair<_Tp1, _Tp2>& __in) _GLIBCXX_NOEXCEPT + inline const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type& + get(const std::pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__const_get(__in); } _GLIBCXX_END_NAMESPACE_VERSION