220 35118 <1f284e0dd9faeabf60b45140e4c1a2b3@kdab.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Marc Mutz <marc.mutz@kdab.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Marking more std::string_view members noexcept
Date: Thu, 26 Oct 2017 19:44:04 +0200
Organization: KDAB
Lines: 32
Approved: news@gmane.org
Message-ID: <1f284e0dd9faeabf60b45140e4c1a2b3@kdab.com>
References: <3d03cd7d-2177-98fd-408d-f74b1f6a8552@gmail.com>
 <3446274.dRsjijLxpX@tjmaciei-mobl1>
 <a82f7b048d91673203c75fa04e98f481@kdab.com>
 <1931282.giciDSTxGt@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; format=flowed
X-Trace: blaine.gmane.org 1509039857 30040 195.159.176.226 (26 Oct 2017 17:44:17 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 26 Oct 2017 17:44:17 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCRPXDOU7ECRB3V5ZDHQKGQEH5LRBTI@isocpp.org Thu Oct 26 19:44:12 2017
Return-path: <std-proposals+bncBCRPXDOU7ECRB3V5ZDHQKGQEH5LRBTI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f69.google.com ([74.125.82.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCRPXDOU7ECRB3V5ZDHQKGQEH5LRBTI@isocpp.org>)
	id 1e7mCN-0006qm-Q0
	for gclcip-std-proposals@m.gmane.org; Thu, 26 Oct 2017 19:44:07 +0200
Original-Received: by mail-wm0-f69.google.com with SMTP id z77sf2180794wmc.16
        for <gclcip-std-proposals@m.gmane.org>; Thu, 26 Oct 2017 10:44:15 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1509039855; cv=pass;
        d=google.com; s=arc-20160816;
        b=hHkvvCpJCMgQsqrg/D1L2v+14BLvnixY3mKUujtKBMuHwGCyj/RcbvzXiHaSAANR3X
         w/v9YvLKGNp2e5dhwIuSM9xno07fpb9+/2HgJzj/b+ge3QCpR1VOgtnuepCYEJSQLMTH
         dIAB4KvPPpx7rWQkiR/PUxPvY0Jzb3UU7GUC0qPwtSZNlVAjsev0pAC/CFpvm3AIl5Si
         Y+0AAnuLF3u6ZtqDyr92R5PJn2qAkatu8EaUhpN6109+pJoWxz82SFJO+Ba2huKlQqPf
         /Ig7xq4eaOsWnTB6U/emHnH/LSUrMeyhVI/mJFp2QbPURCPzSNVjNLWFQiOye07rA1i2
         xreg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:message-id:references
         :in-reply-to:organization:subject:to:from:date:mime-version
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=Fc/fsi5eafj5fp96SZVP5BzCO+XF+FB3gUay+1zkOso=;
        b=ZeSFwsOA/nCFZmeEnDvFmHhjxmSgwrdupv7LIO0v7jneUWpEuhE83cVnNZtwG7Vrlv
         Bvi6yelUfTT9cs2uoVZPTgc1fEeHi9kYmM+CaeEhIGbERmqzfEOLN0l8iZleKf7S8Mee
         MOveU4qpmz48OMAwdngnIxt1U1D7ADVluXKWpMyTuKDToSH3Vl90+2ElbeOkcZwlWaDt
         9xlnZYIMVCvyulYx95ZzqoXJNnC4rRLqS4JPx/gm+YFqyzrJmhU4gw/zPoqprAayRPPG
         eHb2fhbpysSPgysx0YKzHDX+e9xtA1Yj1DYNK2fDB+pWVCjuSvJetBvMC2MZup9X84+V
         r90w==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of marc.mutz@kdab.com designates 176.9.126.58 as permitted sender) smtp.mailfrom=marc.mutz@kdab.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:date:from:to:subject:organization:in-reply-to
         :references:message-id:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=Fc/fsi5eafj5fp96SZVP5BzCO+XF+FB3gUay+1zkOso=;
        b=eYlEVavd4+1C12A/TepLg1bzkWOAKY3wct2fygYBxiIyvWMxxyKT1wIKNQr6NkVCkk
         bKp6JVEeG7XdcW4GniqMUxl1x8BWYZt1qBBxVvVcsXbhp7xBNzUVSGDaohtsFVREI5il
         3Wpl2QHF97ebe/ZaoOYk4xWrJZDHZv1JUOGXa5nJ2JijbCRCyeeMl32HyipMcsT73QkS
         L7GEJ4QEP99OspphBprxVMpaavOpNT8vTVZSohWl3P/zmW3VmqqRls/ixC6EpEF8xky2
         lse+AZRTpHhag5tS+siZh0b/48KvR4fU1yGO15NGFja4ndFnPSiUVnjiUEF0cOnBQowZ
         BAKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:date:from:to:subject:organization
         :in-reply-to:references:message-id:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=Fc/fsi5eafj5fp96SZVP5BzCO+XF+FB3gUay+1zkOso=;
        b=j5szdS5tc8TQhcmXa7oJLJE3eW/Giq470AKwuU/+EYCk8qfGUwsElxYQce4Pl9SmLm
         EpMTOSz/M1MaycixUVy6PhzBUji4bIIjbiQ7Hq/wAMLxyuXAm/dvotplQwEbQPf5YeBr
         p7HhnYw+VninYX2zMZGzRNRJc2kZgfAaGzFNQPojJzm6+BiR2LlIRa/2DuPqDiKJCUgJ
         fEg2rpzY+B+TH490H3xNQ3U2SwjLc9SrfHr8DYcOXNEcy69IxolW2g5LYhRLHs/V+Ist
         W7NcNCiOlqla3DQGWCtHxcMVUtzHmvvLL/4I05piGo4XNxcsOGG8MzF3eeNDPRz5Xpyy
         buFw==
X-Gm-Message-State: AMCzsaUq5SldMYV660V2+aYxzZDgZl0qq3v6GusnO7DYuPev/dOxAsVu
	rBLwzd6HIwfB62h8B2Xpm+6POQ==
X-Google-Smtp-Source: ABhQp+R2r/DDXC3l12yXeimuJOgj7MEx8i8bh658RD4Qp0ytk9NvsGxTAWfWBA/G+oDL3nKkZynwEA==
X-Received: by 10.28.156.145 with SMTP id f139mr302490wme.10.1509039855250;
        Thu, 26 Oct 2017 10:44:15 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.191.29 with SMTP id p29ls28093wmf.8.canary-gmail; Thu, 26
 Oct 2017 10:44:14 -0700 (PDT)
X-Received: by 10.223.142.208 with SMTP id q74mr6686121wrb.172.1509039854133;
        Thu, 26 Oct 2017 10:44:14 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1509039854; cv=none;
        d=google.com; s=arc-20160816;
        b=d06HSPKGObOjRJN6RlQfh9PEDi8AUDl7P2yuUfJ4F7g6ZxoGr/4kR7jbv9RYX1duuY
         j7BkTCskKDePpXa47ZfUHasyPQTRz3Tof1oFDoZUgs8ewvHlJBrBpRyrlyo7wqIxp41r
         wWEAipGJ4KhpYUmthtfmI+V+207dRSAGM/HU7KUh/CyZwhCA02H+MA6015C4TisOYhGA
         5Ucw22xD63//sbRF41ZG2/IkC0fOvLYexSMu4HnSP0EMWGbNuF3FeZGq/sDJXIZrC8Ku
         gnzGAhISUm5FLa8mbADShK5Fat9cEnEXHK3HZSDPfuW82tQ3H0ftVgtehHQeGvWdO4ra
         8glQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=message-id:references:in-reply-to:organization:subject:to:from:date
         :content-transfer-encoding:mime-version:arc-authentication-results;
        bh=duJJtoqW/FNAibKdceD/BEuYnssj9hRkGh0fmjTraUY=;
        b=GCMNaexYPx/sF63hlZNUxmmdwUie2bI20rdyjQls84iZ4G1YOcRfd1t/N9vH97L+Wb
         SgQG/HjpnXIt+j/THKbY0pvj7+hJ9hWe2MYPy3TyThklXRLRpKpMnjhvZN5ogtpb1yUv
         K3PMDjwj7HjxjC22JYqTr1p3AdKiqXoHBS62s+nTqd1tqEsRV0g1rhwmg/CXSsWdx4eR
         x3uOA4j1N15/qyqsgwZoSGg1iDpQdKCnCKYvsWm4D3Y35Xex8FYtBnReZ1vHkAf6mwc3
         w+dDlf4IjC6PX7mZXEmGTY/RcVBci0WwNsv6fE6RVEKXYn4MUboD4mDq+5zKPGTY0SZy
         quhA==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of marc.mutz@kdab.com designates 176.9.126.58 as permitted sender) smtp.mailfrom=marc.mutz@kdab.com
Original-Received: from mail.kdab.com (mail.kdab.com. [176.9.126.58])
        by mx.google.com with ESMTPS id o70si1331047wmd.69.2017.10.26.10.44.14
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 26 Oct 2017 10:44:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of marc.mutz@kdab.com designates 176.9.126.58 as permitted sender) client-ip=176.9.126.58;
X-Virus-Scanned: amavisd-new at kdab.com
In-Reply-To: <1931282.giciDSTxGt@tjmaciei-mobl1>
X-Sender: marc.mutz@kdab.com
X-Original-Sender: marc.mutz@kdab.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of marc.mutz@kdab.com designates 176.9.126.58 as permitted sender) smtp.mailfrom=marc.mutz@kdab.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:35118
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/35118>

On 2017-10-26 18:09, Thiago Macieira wrote:
> On Thursday, 26 October 2017 01:55:04 PDT Marc Mutz wrote:
>> > Calculating the length of char16_t* can't be done in a constexpr way.
>> 
>> ... is only C++14-constexpr (well, if you want to support reasonably
>> long strings, otherwise you could come up with a recursive
>> implementation).
> 
> No, it's not constexpr at all, since I can't run SSE or do 
> reinterpret_cast
> from pointer to integer and back in constexpr mode.
> 
> See http://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/
> qstring.cpp#n163

You'd think compilers would recognize an inlined strlen call and throw 
their own vectoriser at it, no? If not strlen, what else could they 
possibly auto-vectorise at all? :)

And, yes, you can call such functions in constexpr functions: Just loop 
inline for, say, 64bytes and, if you haven't found the end by then, call 
the out-of-line hand-optimized function to do the rest.

Thanks,
Marc

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/1f284e0dd9faeabf60b45140e4c1a2b3%40kdab.com.

.
