From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by sourceware.org (Postfix) with ESMTPS id 2B33E385DC14; Sat, 23 May 2020 14:02:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2B33E385DC14 Received: by mail-ej1-x641.google.com with SMTP id x20so16083969ejb.11; Sat, 23 May 2020 07:02:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=hKZKPUNBwxxXDBqkdajSDq/zlvUsI7CfDfgyhsVAPwE=; b=V3TljdBMiEoM+ymFhNMTGGWcsb9v7iTK76d5XOOVat1VW8s9Bs/GokFyCC/fj2Tce6 YyVIgmbLnQkQeeGeHtJWRosPuyK1vbXKkvxgsmr+cFoheZMzgBU4t+SUdRp+e33Z2Gj/ XhXB9FnwJyZowl7FbFXchsE5GjY06Woa9CKLRXQ0N4ZFZaEN3EOb6/V9jVbWjh/lSD3i TO16Y4GwVgl9J8IzxPnxUk4GkaR0DP/x5uOunfnd+C/tEv4JB9mJPpUD+CMll+Gj96mT bBCHoeJD1TbN7zZhPpgYachNUwPU/2xasB4bGTb0wF+0Hhyo303FifoERS5O9vmeVeAp 2oog== X-Gm-Message-State: AOAM531VRS3l+KDcfOjL8R6bhtfsr6MgMKj2/5XWyOD2zNeNqchQ+UJF 39XCGM596L183NZKtA3NB+EWl364 X-Google-Smtp-Source: ABdhPJzPMcAaYfvSbKmAzDMtQQOSIB7doPoWEN0wsbIue+Sq6UvQ6xk74koY9hmEOh+G/POTVp4AiA== X-Received: by 2002:a17:906:4353:: with SMTP id z19mr12944671ejm.371.1590242529895; Sat, 23 May 2020 07:02:09 -0700 (PDT) Received: from [192.168.1.75] (38.200.13.93.rev.sfr.net. [93.13.200.38]) by smtp.googlemail.com with ESMTPSA id w10sm10672739eju.106.2020.05.23.07.02.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 May 2020 07:02:08 -0700 (PDT) Subject: Re: [PATCH] Extend std::copy/std::copy_n char* overload to deque iterator From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= To: Jonathan Wakely Cc: "libstdc++@gcc.gnu.org" , gcc-patches References: <20200521121712.GC2678@redhat.com> <1f3fe6ef-cd1a-5fad-7d2b-a01a80a37269@gmail.com> Message-ID: <46cf013f-4e0d-9f7d-115d-6c7ad3abfba8@gmail.com> Date: Sat, 23 May 2020 16:02:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1f3fe6ef-cd1a-5fad-7d2b-a01a80a37269@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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-List-Received-Date: Sat, 23 May 2020 14:02:12 -0000 On 22/05/20 10:57 pm, François Dumont wrote: > On 21/05/20 2:17 pm, Jonathan Wakely wrote: >> >> Why is the optimization not done for C++03 mode? >> > I did it this way because the new std::copy overload rely on > std::copy_n implementation details which is a C++11 algo. > > >> It looks like the uses of 'auto' can be reaplced easily, and >> __enable_if_t<> can be replaced with __gnu_cxx::__enable_if<>::__type. >> > But yes, we can indeed provide those implementation details in pre-C++11. > > This is what I've done in this new version. Note that I expose all __copy_n_a overloads in stl_algobase.h and not only the overload needed for the std::copy. Let me know if you prefer to limit it. > > Tested under Linux x86_64 in default c++ mode. > > I tried to use CXXFLAGS=-std=c++03 but it doesn't seem to work even if > I do see the option in build logs. I remember you adivised a different > approach, can you tell me again ? > > François > I forgot to mention that "doesn't seem to work" above means that all C++11 or higher tests are reported as FAIL in this case. I was expecting an UNSUPPORTED.