220 34235 <CA+fGSbMtnehJhDx3Bz_GfxsqyrK_ch5hes7aGZqnufrimtG=gQ@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Ricardo Fabiano de Andrade <ricardofabianodeandrade@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: constexpr only functions: arbitrary literal types
 for non-type, constexpr arguments, is_constexpr...
Date: Thu, 31 Aug 2017 15:17:37 -0500
Lines: 1082
Approved: news@gmane.org
Message-ID: <CA+fGSbMtnehJhDx3Bz_GfxsqyrK_ch5hes7aGZqnufrimtG=gQ@mail.gmail.com>
References: <17e156a0-0368-4ec0-a087-e8b4bc8d9f62@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="94eb2c1fb964f4ccea05581255cf"
X-Trace: blaine.gmane.org 1504210678 9717 195.159.176.226 (31 Aug 2017 20:17:58 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 31 Aug 2017 20:17:58 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCJN7V7TRQMBBY65UHGQKGQEONIGAYQ@isocpp.org Thu Aug 31 22:17:49 2017
Return-path: <std-proposals+bncBCJN7V7TRQMBBY65UHGQKGQEONIGAYQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f197.google.com ([209.85.161.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCJN7V7TRQMBBY65UHGQKGQEONIGAYQ@isocpp.org>)
	id 1dnVuB-0001Jo-3J
	for gclcip-std-proposals@m.gmane.org; Thu, 31 Aug 2017 22:17:36 +0200
Original-Received: by mail-yw0-f197.google.com with SMTP id l2sf1674914ywe.23
        for <gclcip-std-proposals@m.gmane.org>; Thu, 31 Aug 2017 13:17:41 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1504210661; cv=pass;
        d=google.com; s=arc-20160816;
        b=buWe71sjxNLlwfzsE7MZmS5f1piXdxy1VgRLUoOxvm3ItdIHderLEYxLpwb2J4DNy5
         r91s8yaZVW4dc34QlSBYOoY/GtmloK0oF3aHwZgg5JGEU4uGR8Fh5hBHN3W2JJUZuvKB
         F22RbBnGXyDx79kzDN3UD3gmEd78wuZF2Of/lYgp1UXPxnpfR8gFKKYjp1Gdky/dxuOh
         RBPj8r4PQjSMjkQJ2hzAJoVq/SCxT/X0ndB+C5LqmM13Ws/iIueDml2gN9D9R6weozHr
         F7AVZBRKDX/KfY9EltYb9+oSw8IlEq1aNkaRLl02c/QTohlLtcsB1yV1IJIR5O3Jt+9u
         4PvQ==
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:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=dPx7nChmcOEDqCXS1IICc8M4UGnNKuveh0hvRTrMizk=;
        b=NutF0L8A0vPWTc8ymqgsjdZpVh14D0n9IIq9c8aF0HvHn76sFBshIqhpKR4tEr+Pba
         G+YiMW9TFtR5USJBjgq27F1DW4qHGQ5v/AEiettOA2vVnUtXkSCBrdfMFA4VGHLWJkXS
         pAF2cnuw13hROMmpaAdCpB2QVAp06AgqElr2Xb6d3K3FDS+r7rN2IXBWt6rlBA7yjb7r
         mwOttly4Y1r20uX/reldyoYmaHdBHvJ4LJxeycpYQRlaFNos78nmZ2l/6QwoIz+HT1u0
         fJ/QYIVhBjALgCgxl2/QL0HLE1ocaf8H6Pa7Oh/FKrx2qFePeZPKWPbux4oyO2+2F1Lq
         mFIw==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=m54aefTk;
       spf=pass (google.com: domain of ricardofabianodeandrade@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=ricardofabianodeandrade@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :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=dPx7nChmcOEDqCXS1IICc8M4UGnNKuveh0hvRTrMizk=;
        b=BJcOvtSZw7FiY94Cy4wWPGRCgMVgevS6OehUirhRI2EPUA80GPKLON/erLkf+dd9hp
         y0alAz//Kpsb5ib4q+Jt3MvUZl7pwGFArzo7QndGQo3LQKbaNfmJXEJf6RlZ4IhV8z64
         cyYOn+mfNY1QnNEgAtsF+PHwRZx8J6RGggUwuT6D6hc1UE3dqhihWL4rWXLgMCnZTlFM
         mosKTbBpfcesw8+o9zI4I4mVFrthCPUJ2Tp6Pj4dVi6p4mwPEWb555YhKuN0UL0zxT/K
         MhWBoCEPROp5VizvJWFczx5lenl1EAOc5Fhp+nFFB2p9Nywz/aM/aKF7oqfDYdijyoIy
         dWGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to: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=dPx7nChmcOEDqCXS1IICc8M4UGnNKuveh0hvRTrMizk=;
        b=laglGKznfadmh0WYkXJWDUos7YLnXehiRBJbtU0EuRedsw/PrUPY/DLYDbFSyYsiN3
         gcwhKZcAD0w0yWZG8GITYn9Gx9pFQoW/gviKEX+9gdwEXm8WT4OyVbiW3THA9gAfc/9K
         rf6SCQK1Q0bCbVyKbDlvpkZhx97BQhPxYVQ7vThycgaD81VhjtnL+PysljxMa/WAFJ6f
         A5c9Z0sHNG7WxvFUU0jRphYwNW6A4LIJPXX4bCdDkIYf6anfogHvE44C59yBIITPaxxD
         qYbhDfq3P+4/mi+YRuYHjyirztLKx18AhvwLx+eriIRE94QdNvEPkwit6KbX1IiLcXlX
         w0ow==
X-Gm-Message-State: AHYfb5ha9aBEMUTtN9+Ya5paRD1fajPPtDmup64szVNXcKeQUyW34nbT
	Apuo5/jIWG3dBbYu
X-Google-Smtp-Source: ADKCNb6YoawqzqhdCII2nfnvfbLoFbDL0relJjXzrTi/h2472SKOCLdRSHXslHVAMKSJc878ZQ4LYg==
X-Received: by 10.129.99.2 with SMTP id x2mr4006228ywb.172.1504210661121;
        Thu, 31 Aug 2017 13:17:41 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.14.73 with SMTP id 70ls279380ioo.45.gmail; Thu, 31 Aug
 2017 13:17:39 -0700 (PDT)
X-Received: by 10.107.46.96 with SMTP id i93mr6609812ioo.161.1504210659182;
        Thu, 31 Aug 2017 13:17:39 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1504210659; cv=none;
        d=google.com; s=arc-20160816;
        b=byFG+5zMtYOYzrwWgZRX0dqOdDY70xBEVw+c104zb7zyiJ4Dsu0W9zCb/RG2R8qkLn
         micGNixajysF7kFNGVuIkQGakHGICvxjzP0Ne7rGlWyF1cvBNI6E2cAWcFW8Z7ZnIloc
         JEHXFEeriojdWs5aprqtSavlBuehMOp2B10eUXgswZwZneLo8jqJd65Dv5PB9XPJUwvH
         PWVM+CncuAQgxeOJo6QOSgKREJxK1HuV/YXkfXyqdYhdSMvJLHGq+cBIJ8pG9f7mpy6U
         majJB2CNUnXOMHyGSooe6emcEKlOpwpWhIeoRHOG3xqnyx08wAYyz5dYFA3Nt0CfeF3t
         VFaA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=GhgNwq2RexEAkFQItDVkMcEics86Y4AVB0hSsOcudn4=;
        b=yjIcFDyMHXaufTIAS2i1VEsujmh7+Thmk3J/tQgqika5W222EV35fUOYpz4aIq1ewW
         O+R0yyrFn/JI+PPGJW3SYhTxscxVHM/TWWH6r/IEWZNt5A9jezKE16C1C0WyjEFy+MGX
         FMYaoXn8kFGaUOlk+FtXgPd5nfJOZPin30vh6uE4wOIaGQNvjXLlJwx+RTzIJb93PxXl
         6VvdP9cGnijBnXtJ73KfeBsWR2lwD+MUgHgyfRFrpMuKwjYkwbUX41bJMRGJGMQTuYnL
         wkOyz0hGDP7g0VyFjD/p/i8/7+c5HBbE6U9uRZlT7NfM5iIc8HD/67F8306xliHU60OR
         n8cg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=m54aefTk;
       spf=pass (google.com: domain of ricardofabianodeandrade@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=ricardofabianodeandrade@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id j82sor569154ite.98.2017.08.31.13.17.39
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Thu, 31 Aug 2017 13:17:39 -0700 (PDT)
Received-SPF: pass (google.com: domain of ricardofabianodeandrade@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 10.36.172.28 with SMTP id s28mr2045882ite.140.1504210658313;
 Thu, 31 Aug 2017 13:17:38 -0700 (PDT)
Original-Received: by 10.107.13.14 with HTTP; Thu, 31 Aug 2017 13:17:37 -0700 (PDT)
In-Reply-To: <17e156a0-0368-4ec0-a087-e8b4bc8d9f62@isocpp.org>
X-Original-Sender: ricardofabianodeandrade@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=m54aefTk;       spf=pass
 (google.com: domain of ricardofabianodeandrade@gmail.com designates
 209.85.220.41 as permitted sender) smtp.mailfrom=ricardofabianodeandrade@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.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:34235
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34235>

--94eb2c1fb964f4ccea05581255cf
Content-Type: text/plain; charset="UTF-8"

Very interesting proposal. Looking forward to hearing additional feedback
from others, I hope it moves forward.
Simple syntax question: why not placing constexpr() next to where
noexcept() is, at the end of the function declaration/definition?
This alternative seems more consistent, even with lamba functions examples.

On Thu, Aug 31, 2017 at 1:43 PM, Bastien Penavayre <swac31@gmail.com> wrote:

> Hi,
>
> So let me pressent the current state of affairs.
>
> There are a bunch of proposals floating around, that, I think, are
> interesting but have issues implementation-wise or are a bit clunky.
> *N3413* (arbitrary literal types for non-type) for instance requires that
> a bunch of controversial questions to be answered to be accepted (mangling,
> operator== or bitwise, ...).
> Because of that this proposal will not come around any time soon.
> At the same time demands to check or enforce constexpr-ness in functions
> were made through the ideas of *forced constexpr arguments* and*
> is_constexpr()*.
>
>    -    The first has the same issues as *N3413* as it requires said
>    constexpr arguments be integrated into the mangling of the function, making
>    this proposal syntax sugar to *N3413*.
>
> //this
> template<Literal l> void func();
> //differs only through call syntax from this
> void func(constexpr Literal l);
>
> //yet this would allow to get rid of atrocious code like this
> template<auto I>
> constexpr auto func(std:integral_constant<decltype(I), I>); //only uses I
>
>    -    The latter (*is_constexpr*) aims to allow a runtime or
>    compile-time specialization through a constexpr expression with a
>    variant value. It would requires long *if constexpr *blocks as, if
>    runtime specialization is required, we can assume that the runtime and
>    compile-time version will share very little code. It would also mean
>    that, despite the confirmation by the compiler that we are in constexpr
>    context with arguments being compile-time evaluated, we would still be
>    incapable to use those as such or would require that *if
>    constexp(is_constexpr()) *have side-effects (big no-no).
>
> constexpr auto func(int i)
> {
>       if constexpr (is_constexpr())
>       {
>           //i is still not usable as a constexpr
>           //long piece of code or call to other function that handles the
> compile-time version
>            ...
>       }
>       else
>       {
>           //long piece of code or call to other function that handles the
> runtime version
>            ....
>       }
> }
>
> Now that the context has been presented here is my proposal with a
> detailed and commented exemple.
> My goal is to allow a big chunk of what the other proposal aimed to allow
> without all their issues and in one proposal.
> It is to allow constexpr-only specialization by borrowing the *noexcept*
> syntax.
> As the function may only be constexpr it will not have linkage and
> therefor no mangling nor all the issues associated with it.
> Now here is a *detailed exemple*.
>
> //compile-time only function
> //it will never have linkage
> //all its arguments are constexpr
> //a non-constexpr expression usage in its definition will cause an error
> instead of a fallback like normal constexpr
> //is only called in an explicit constexpr context unlike normal constexpr
> constexpr(true) auto func(Literal r);
>
> //runtime specialization of func
> /*constexpr(false)*/ auto func(Literal r); //constexpr(false) is the
> default for functions and methods
>
> //error redefinition of 'constexpr(false) void func(Literal)'
> constexpr void func();
>
> constexpr(true) auto func2();
> //allowed
> //constexpr is ignored, retains inline side effect
> constexpr auto func2();
>
> constexpr auto func3();
> constexpr auto error_0 = func3();
> //constexpr specialization of 'func3' after instanciation
> constexpr(true) auto func3();
>
> //addresses demands for partially constexpr argument-list
> constexpr(true) void partial_constexpr(int constant)
> {
>    return [&](auto&&... runtime_args) constexpr /*this lambda has the
> default constexpr behavior*/ {
>        //runtime code
>        //can use 'constant' as a constexpr here
>    };
> }
>
> int main()
> {
>   constexpr auto r_0 = func(Literal{}); //constexpr(true) version called
>   auto r_1 = func(Literal{}); //constexpr(false) version called
>
>   partial_constexpr(42/*compile-time args*/)(/*runtime args*/);
>
>   auto r_2 = constexpr func(Literal{}); //also proposed unary constexpr
> operator for explicit selection, error if the expression is not constexpr
>   //is equivalent to
>   auto r_3 = []() { constexpr auto __ret__ = func(Literal{}); return
> __ret__; }();
> }
>
> //replacing of gnu's operator"" extension
> constexpr(true) auto operator""_string_literal(const char *str, size_t len
> )
> {
>     return [&]<size_t... Indexs>(std::index_sequence<Indexs...>&&)
>     {
>        return TemplateCharSeq<str[Indexs]...>{};
>     }(std::make_index_sequence<len>{});
> }
>
> //operator[] for std::tuple
> template <class... Args>
> struct tuple
> {
>    ...
>    constexpr(true) auto& operator[](size_t i) const
>    {
>       static_assert(i < sizeof...(Args));
>       return std::get<i>(*this);
>    }
>
>    constexpr(true) auto& operator[](size_t i)
>    {
>       static_assert(i < sizeof...(Args));
>       return std::get<i>(*this);
>    }
>    ....
> };
>
> template <class... Args> struct Select : Args... { using Args::operator
> ()...; };
> template <class... Args> Select(Args&&...) -> Select<Args...>;
>
> //for lambdas
> void func_3()
> {
>   constexpr auto f_0 = []() {}; //operator() is constexpr /*fallback on
> runtime*/, no changes
>   constexpr auto f_1 = []() constexpr(false) {}; //operator() cannot be
> called at compile-time
>   constexpr auto f_2 = []() constexpr(true) {}; //operator() can only be
> called a compile-time and explicitly
>
>   constexpr Select f_3 = { f_1, f_2 };
>
>   constexpr auto r_4 = f_3(); //f_2
>   auto r_5 = f_3(); //f_1
> }
>
> Here is the summary:
>
> - extend constexpr specifier to allow it to take a constexpr explicit bool
> (no a constexpr expression unless if there are good use-cases for it) where:
>
>    - constexpr(false) is the default specifier of a function/method
>       - optional for functions/method.
>       - if specified with lambdas allows not-constexpr lambda as lambdas
>       are by default constexpr.
>    - constexpr(true) is a constexpr only function.
>       - no Assembly representation (no linkage nor mangling).
>       - all arguments are constexpr.
>       - error if non-constexpr expression is used (a constexpr fallback
>       to runtime because of an overflow for instance).
>       - only used in explicit constexpr context.
>       - cannot be called before its specialization if specialization or
>       else error.
>       - constexpr
>       - keeps all its properties and definition.
>       - will still trigger redefinition error if previous
>       constexpr(false) version previously defined.
>       - constexpr attribute ignored if previous constexpr(true) is
>       defined.
>
> - unary constexpr operator to request a constexpr expression explicitly:
>    auto t = constexpr expr; //might error if expr is no a constexpr
> expression
>
> The reason why I believe in this proposal:
>
>    - no new keyword.
>    - zero runtime impact.
>    - maintains backward compatibility.
>    - solves, at least partially, a lot of different proposals.
>
> Thanks in advance,
>
> Bastien Penavayre,
> bastienPenava@gmail.com
>
> --
> 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/17e156a0-0368-4ec0-
> a087-e8b4bc8d9f62%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/17e156a0-0368-4ec0-a087-e8b4bc8d9f62%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CA%2BfGSbMtnehJhDx3Bz_GfxsqyrK_ch5hes7aGZqnufrimtG%3DgQ%40mail.gmail.com.

--94eb2c1fb964f4ccea05581255cf
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Very interesting proposal. Looking forward to hearing addi=
tional feedback from others, I hope it moves forward.<div>Simple syntax que=
stion: why not placing constexpr() next to where noexcept() is, at the end =
of the function declaration/definition?</div><div>This alternative seems mo=
re consistent, even with lamba functions examples.<br></div></div><div clas=
s=3D"gmail_extra"><br><div class=3D"gmail_quote">On Thu, Aug 31, 2017 at 1:=
43 PM, Bastien Penavayre <span dir=3D"ltr">&lt;<a href=3D"mailto:swac31@gma=
il.com" target=3D"_blank">swac31@gmail.com</a>&gt;</span> wrote:<br><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex"><div dir=3D"ltr">Hi,=C2=A0<div><div><br></div><div>=
So let me pressent the current state of affairs.</div><div><br></div><div>T=
here are a bunch of proposals floating around, that, I think, are interesti=
ng but have issues implementation-wise or are a bit clunky.</div><div><font=
 style=3D"font-family:arial,sans-serif;color:rgb(0,0,0)" size=3D"2"><b styl=
e=3D"font-style:italic">N3413</b> (</font><font color=3D"#000000" face=3D"a=
rial, sans-serif"><font size=3D"2">arbitrary literal types for non-type)</f=
ont><font size=3D"2" style=3D"font-style:italic;font-weight:bold">=C2=A0</f=
ont><font size=3D"2">f</font></font><font style=3D"font-family:arial,sans-s=
erif"><font color=3D"#000000">or instance requires=C2=A0that a bunch of con=
troversial questions to be answered to be accepted (mangling, operator=3D=
=3D or bitwise, ...).</font></font></div><div>Because of that this proposal=
 will not come around any time soon.<br></div><div><font color=3D"#000000" =
face=3D"arial, sans-serif" size=3D"2">At the same time demands to check or =
enforce constexpr-ness in functions were made through the ideas of <b><i>fo=
rced constexpr arguments</i></b> and<i><b> is_constexpr()</b></i>.</font></=
div><div><ul><li>=C2=A0 =C2=A0The first has the same issues as <b><i>N3413<=
/i></b> as it requires said constexpr arguments be integrated into the mang=
ling of the function, making this proposal syntax sugar to <b><i>N3413</i><=
/b>.</li></ul></div><div><div class=3D"m_-5563334057486048prettyprint" styl=
e=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);border=
-style:solid;border-width:1px;word-wrap:break-word"><code class=3D"m_-55633=
34057486048prettyprint"><div class=3D"m_-5563334057486048subprettyprint"><s=
pan style=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify">//=
this</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by=
-prettify"><br></span><span style=3D"color:#008" class=3D"m_-55633340574860=
48styled-by-prettify">template</span><span style=3D"color:#660" class=3D"m_=
-5563334057486048styled-by-prettify">&lt;</span><span style=3D"color:#606" =
class=3D"m_-5563334057486048styled-by-prettify">Literal</span><span style=
=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> l</span><s=
pan style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">&g=
t;</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-p=
rettify"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048sty=
led-by-prettify">void</span><span style=3D"color:#000" class=3D"m_-55633340=
57486048styled-by-prettify"> func</span><span style=3D"color:#660" class=3D=
"m_-5563334057486048styled-by-prettify">();</span><span style=3D"color:#000=
" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span style=3D=
"color:#800" class=3D"m_-5563334057486048styled-by-prettify">//differs only=
 through call syntax from this</span><span style=3D"color:#000" class=3D"m_=
-5563334057486048styled-by-prettify"><br></span><span style=3D"color:#008" =
class=3D"m_-5563334057486048styled-by-prettify">void</span><span style=3D"c=
olor:#000" class=3D"m_-5563334057486048styled-by-prettify"> func</span><spa=
n style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">(</s=
pan><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pretti=
fy">constexpr</span><span style=3D"color:#000" class=3D"m_-5563334057486048=
styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_-55633340=
57486048styled-by-prettify">Literal</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"> l</span><span style=3D"color:#6=
60" class=3D"m_-5563334057486048styled-by-prettify">);</span><span style=3D=
"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br><br></span=
><span style=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify"=
>//yet this would allow to get rid of atrocious code like this</span><span =
style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br></=
span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-prett=
ify">template</span><span style=3D"color:#660" class=3D"m_-5563334057486048=
styled-by-prettify">&lt;</span><span style=3D"color:#008" class=3D"m_-55633=
34057486048styled-by-prettify">auto</span><font color=3D"#000088"><span sty=
le=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> I</span>=
<span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">=
&gt;</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by=
-prettify"><br></span><span style=3D"color:#008" class=3D"m_-55633340574860=
48styled-by-prettify">constexpr</span><span style=3D"color:#000" class=3D"m=
_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#008" cl=
ass=3D"m_-5563334057486048styled-by-prettify">auto</span><span style=3D"col=
or:#000" class=3D"m_-5563334057486048styled-by-prettify"> func</span><span =
style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">(</spa=
n><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify=
">std</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-b=
y-prettify">:</span><span style=3D"color:#000" class=3D"m_-5563334057486048=
styled-by-prettify">integral_constant</span><span style=3D"color:#660" clas=
s=3D"m_-5563334057486048styled-by-prettify">&lt;</span><span style=3D"color=
:#008" class=3D"m_-5563334057486048styled-by-prettify">dec<wbr>ltype</span>=
<span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">=
(</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-pr=
ettify">I</span><span style=3D"color:#660" class=3D"m_-5563334057486048styl=
ed-by-prettify">),</span><span style=3D"color:#000" class=3D"m_-55633340574=
86048styled-by-prettify"> I</span><span style=3D"color:#660" class=3D"m_-55=
63334057486048styled-by-prettify">&gt;);</span><span style=3D"color:#000" c=
lass=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"color=
:#800" class=3D"m_-5563334057486048styled-by-prettify">//only uses I</span>=
<span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">=
<br></span></font></div></code></div></div><div><ul><li>=C2=A0 =C2=A0The la=
tter (<i><b>is_constexpr</b></i>) aims to allow a runtime or compile-time s=
pecialization<font color=3D"#000000" face=3D"arial, sans-serif">=C2=A0throu=
gh a constexpr expression with a variant value. It would requires long </fo=
nt><i style=3D"font-size:small;color:rgb(0,0,0);font-family:arial,sans-seri=
f">if constexpr </i><span style=3D"font-size:small;color:rgb(0,0,0);font-fa=
mily:arial,sans-serif">blocks</span><i style=3D"font-size:small;color:rgb(0=
,0,0);font-family:arial,sans-serif">=C2=A0</i><span style=3D"font-size:smal=
l;color:rgb(0,0,0);font-family:arial,sans-serif">as, if runtime specializat=
ion is required, we can assume that the runtime and compile-time version wi=
ll share very little code. It=C2=A0</span><font color=3D"#000000" face=3D"a=
rial, sans-serif">would also mean that, despite the confirmation by the com=
piler that we are in constexpr context with arguments being compile-time ev=
aluated, we would still be incapable=C2=A0to use those as such or would req=
uire that <i><b>if constexp(is_constexpr()) </b></i>have side-effects (big =
no-no).</font><br></li></ul></div><div class=3D"m_-5563334057486048prettypr=
int" style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,18=
7);border-style:solid;border-width:1px;word-wrap:break-word"><code class=3D=
"m_-5563334057486048prettyprint"><div class=3D"m_-5563334057486048subpretty=
print"><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pre=
ttify">constexpr</span><span style=3D"color:#000" class=3D"m_-5563334057486=
048styled-by-prettify"> </span><span style=3D"color:#008" class=3D"m_-55633=
34057486048styled-by-prettify">auto</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"> func</span><span style=3D"color=
:#660" class=3D"m_-5563334057486048styled-by-prettify">(</span><span style=
=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">int</span><=
span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> =
i</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-pr=
ettify">)</span><span style=3D"color:#000" class=3D"m_-5563334057486048styl=
ed-by-prettify"><br></span><span style=3D"color:#660" class=3D"m_-556333405=
7486048styled-by-prettify">{</span><span style=3D"color:#000" class=3D"m_-5=
563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span st=
yle=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">if</span=
><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"=
> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-p=
rettify">constexpr</span><span style=3D"color:#000" class=3D"m_-55633340574=
86048styled-by-prettify"> </span><span style=3D"color:#660" class=3D"m_-556=
3334057486048styled-by-prettify">(</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify">is_constexpr</span><span style=
=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">())</span><=
span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><=
br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#660" class=3D"m_-55633=
34057486048styled-by-prettify">{</span><span style=3D"color:#000" class=3D"=
m_-5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 </span><span style=3D"color:#800" class=3D"m_-5563334057486048styled-by=
-prettify">//i is still not usable as a constexpr</span><span style=3D"colo=
r:#000" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#800" class=3D"m_-55633340=
57486048styled-by-prettify">//long piece of code or call to other function =
that handles the compile-time version</span><span style=3D"color:#000" clas=
s=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0</span><span style=3D"color:#660" class=3D"m_-556333405748604=
8styled-by-prettify">...</span><span style=3D"color:#000" class=3D"m_-55633=
34057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=
=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">}</span><sp=
an style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br=
>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#008" class=3D"m_-5563334=
057486048styled-by-prettify">else</span><span style=3D"color:#000" class=3D=
"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><sp=
an style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">{</=
span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prett=
ify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#80=
0" class=3D"m_-5563334057486048styled-by-prettify">//long piece of code or =
call to other function that handles the runtime version</span><span style=
=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D"color:#660" class=
=3D"m_-5563334057486048styled-by-prettify">....</span><span style=3D"color:=
#000" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=
=A0 </span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by=
-prettify">}</span><span style=3D"color:#000" class=3D"m_-5563334057486048s=
tyled-by-prettify"><br></span><span style=3D"color:#660" class=3D"m_-556333=
4057486048styled-by-prettify">}</span><span style=3D"color:#000" class=3D"m=
_-5563334057486048styled-by-prettify"><br></span></div></code></div><div><b=
r></div><div>Now that the context has been presented here is my proposal wi=
th a detailed and commented exemple.</div><div>My goal is to allow a big ch=
unk of what the other proposal aimed to allow without all their issues and =
in one proposal.</div><div>It is to allow constexpr-only specialization by =
borrowing the <i><b>noexcept</b></i> syntax.</div><div>As the function may =
only be constexpr it will not have linkage and therefor no mangling nor all=
 the issues associated with it.</div><div>Now here is a <b>detailed exemple=
</b>.</div><div><br></div><div class=3D"m_-5563334057486048prettyprint" sty=
le=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);borde=
r-style:solid;border-width:1px;word-wrap:break-word"><code class=3D"m_-5563=
334057486048prettyprint"><div class=3D"m_-5563334057486048subprettyprint"><=
span style=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify">/=
/compile-time only function</span><span style=3D"color:#000" class=3D"m_-55=
63334057486048styled-by-prettify"><br></span><span style=3D"color:#800" cla=
ss=3D"m_-5563334057486048styled-by-prettify">//it will never have linkage</=
span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prett=
ify"><br></span><span style=3D"color:#800" class=3D"m_-5563334057486048styl=
ed-by-prettify">//all its arguments are constexpr</span><span style=3D"colo=
r:#000" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span st=
yle=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify">//a non-=
constexpr expression usage in its definition will cause an error instead of=
 a fallback like normal constexpr</span><span style=3D"color:#000" class=3D=
"m_-5563334057486048styled-by-prettify"><br></span><span style=3D"color:#80=
0" class=3D"m_-5563334057486048styled-by-prettify">//is only called in an e=
xplicit constexpr context unlike normal constexpr</span><span style=3D"colo=
r:#000" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span st=
yle=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexp=
r</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-pr=
ettify">(</span><span style=3D"color:#008" class=3D"m_-5563334057486048styl=
ed-by-prettify">true</span><span style=3D"color:#660" class=3D"m_-556333405=
7486048styled-by-prettify">)</span><span style=3D"color:#000" class=3D"m_-5=
563334057486048styled-by-prettify"> </span><span style=3D"color:#008" class=
=3D"m_-5563334057486048styled-by-prettify">auto</span><span style=3D"color:=
#000" class=3D"m_-5563334057486048styled-by-prettify"> func</span><span sty=
le=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">(</span><=
span style=3D"color:#606" class=3D"m_-5563334057486048styled-by-prettify">L=
iteral</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-=
by-prettify"> r</span><span style=3D"color:#660" class=3D"m_-55633340574860=
48styled-by-prettify">)</span><font color=3D"#000000"><span style=3D"color:=
#660" class=3D"m_-5563334057486048styled-by-prettify">;</span></font><span =
style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br><b=
r></span><span style=3D"color:#800" class=3D"m_-5563334057486048styled-by-p=
rettify">//runtime specialization of func</span><span style=3D"color:#000" =
class=3D"m_-5563334057486048styled-by-prettify"><br></span><span style=3D"c=
olor:#800" class=3D"m_-5563334057486048styled-by-prettify">/*constexpr(fals=
e)*/</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by=
-prettify"> </span><font color=3D"#000088"><span style=3D"color:#008" class=
=3D"m_-5563334057486048styled-by-prettify">auto</span></font><span style=3D=
"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> func</span><s=
pan style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">(<=
/span><span style=3D"color:#606" class=3D"m_-5563334057486048styled-by-pret=
tify">Literal</span><span style=3D"color:#000" class=3D"m_-5563334057486048=
styled-by-prettify"> r</span><span style=3D"color:#660" class=3D"m_-5563334=
057486048styled-by-prettify">);</span><span style=3D"color:#000" class=3D"m=
_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#800" cl=
ass=3D"m_-5563334057486048styled-by-prettify">//constexpr(false) is the def=
ault for functions and methods</span><span style=3D"color:#000" class=3D"m_=
-5563334057486048styled-by-prettify"><br><br></span><span style=3D"color:#8=
00" class=3D"m_-5563334057486048styled-by-prettify">//error redefinition of=
 &#39;constexpr(false) void func(Literal)&#39;</span><span style=3D"color:#=
000" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span style=
=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexpr</=
span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prett=
ify"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-=
by-prettify">void</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"> func</span><span style=3D"color:#660" class=3D"m_-=
5563334057486048styled-by-prettify">();</span><span style=3D"color:#000" cl=
ass=3D"m_-5563334057486048styled-by-prettify"><br><br></span><span style=3D=
"color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexpr</spa=
n><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify=
">(</span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-=
prettify">true</span><span style=3D"color:#660" class=3D"m_-556333405748604=
8styled-by-prettify">)</span><span style=3D"color:#000" class=3D"m_-5563334=
057486048styled-by-prettify"> </span><span style=3D"color:#008" class=3D"m_=
-5563334057486048styled-by-prettify">auto</span><span style=3D"color:#000" =
class=3D"m_-5563334057486048styled-by-prettify"> func2</span><span style=3D=
"color:#660" class=3D"m_-5563334057486048styled-by-prettify">()</span><font=
 color=3D"#000000"><span style=3D"color:#660" class=3D"m_-5563334057486048s=
tyled-by-prettify">;</span><span style=3D"color:#000" class=3D"m_-556333405=
7486048styled-by-prettify"><br></span><span style=3D"color:#800" class=3D"m=
_-5563334057486048styled-by-prettify">//allowed</span><span style=3D"color:=
#000" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span styl=
e=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify">//constexp=
r is ignored, retains inline side effect</span><span style=3D"color:#000" c=
lass=3D"m_-5563334057486048styled-by-prettify"><br></span></font><span styl=
e=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexpr<=
/span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-pret=
tify"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled=
-by-prettify">auto</span><span style=3D"color:#000" class=3D"m_-55633340574=
86048styled-by-prettify"> func2</span><span style=3D"color:#660" class=3D"m=
_-5563334057486048styled-by-prettify">()</span><font color=3D"#000000"><spa=
n style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">;</s=
pan><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-pretti=
fy"><br><br></span><span style=3D"color:#008" class=3D"m_-5563334057486048s=
tyled-by-prettify">constexpr</span><span style=3D"color:#000" class=3D"m_-5=
563334057486048styled-by-prettify"> </span><span style=3D"color:#008" class=
=3D"m_-5563334057486048styled-by-prettify">auto</span><span style=3D"color:=
#000" class=3D"m_-5563334057486048styled-by-prettify"> func3</span><span st=
yle=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">();</spa=
n><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify=
"><br></span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-=
by-prettify">constexpr</span><span style=3D"color:#000" class=3D"m_-5563334=
057486048styled-by-prettify"> </span><span style=3D"color:#008" class=3D"m_=
-5563334057486048styled-by-prettify">auto</span><span style=3D"color:#000" =
class=3D"m_-5563334057486048styled-by-prettify"> error_0 </span><span style=
=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">=3D</span><=
span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> =
func3</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-b=
y-prettify">();</span><span style=3D"color:#000" class=3D"m_-55633340574860=
48styled-by-prettify"><br></span><span style=3D"color:#800" class=3D"m_-556=
3334057486048styled-by-prettify">//constexpr specialization of &#39;func3&#=
39; after instanciation</span><span style=3D"color:#000" class=3D"m_-556333=
4057486048styled-by-prettify"><br></span><span style=3D"color:#008" class=
=3D"m_-5563334057486048styled-by-prettify">constexpr</span><span style=3D"c=
olor:#660" class=3D"m_-5563334057486048styled-by-prettify">(</span><span st=
yle=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">true</sp=
an><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettif=
y">)</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by=
-prettify"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048s=
tyled-by-prettify">auto</span><span style=3D"color:#000" class=3D"m_-556333=
4057486048styled-by-prettify"> func3</span><span style=3D"color:#660" class=
=3D"m_-5563334057486048styled-by-prettify">();</span></font><span style=3D"=
color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br><br></span>=
<span style=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify">=
//addresses demands for partially constexpr argument-list</span><span style=
=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br></span>=
<span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">=
constexpr</span><span style=3D"color:#660" class=3D"m_-5563334057486048styl=
ed-by-prettify">(</span><span style=3D"color:#008" class=3D"m_-556333405748=
6048styled-by-prettify">true</span><span style=3D"color:#660" class=3D"m_-5=
563334057486048styled-by-prettify">)</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#00=
8" class=3D"m_-5563334057486048styled-by-prettify">void</span><span style=
=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> partial_co=
nstexpr</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled=
-by-prettify">(</span><span style=3D"color:#008" class=3D"m_-55633340574860=
48styled-by-prettify">int</span><span style=3D"color:#000" class=3D"m_-5563=
334057486048styled-by-prettify"> constant</span><span style=3D"color:#660" =
class=3D"m_-5563334057486048styled-by-prettify">)</span><span style=3D"colo=
r:#000" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span st=
yle=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">{</span>=
<span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">=
<br>=C2=A0 =C2=A0</span><span style=3D"color:#008" class=3D"m_-556333405748=
6048styled-by-prettify">return</span><span style=3D"color:#000" class=3D"m_=
-5563334057486048styled-by-prettify"> </span><span style=3D"color:#660" cla=
ss=3D"m_-5563334057486048styled-by-prettify">[&amp;](</span><span style=3D"=
color:#008" class=3D"m_-5563334057486048styled-by-prettify">auto</span><spa=
n style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">&amp=
;&amp;...</span><span style=3D"color:#000" class=3D"m_-5563334057486048styl=
ed-by-prettify"> runtime_args</span><span style=3D"color:#660" class=3D"m_-=
5563334057486048styled-by-prettify">)</span><span style=3D"color:#000" clas=
s=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#0=
08" class=3D"m_-5563334057486048styled-by-prettify">constexpr</span><span s=
tyle=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span=
><span style=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify"=
>/*this lambda has the default constexpr behavior*/</span><span style=3D"co=
lor:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><span sty=
le=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">{</span><=
span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><=
br>=C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D"color:#800" class=3D"m_=
-5563334057486048styled-by-prettify">//runtime code</span><span style=3D"co=
lor:#000" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0</span><span style=3D"color:#800" class=3D"m_-556333405748604=
8styled-by-prettify">//can use &#39;constant&#39; as a constexpr here</span=
><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"=
><br>=C2=A0 =C2=A0</span><span style=3D"color:#660" class=3D"m_-55633340574=
86048styled-by-prettify">};</span><span style=3D"color:#000" class=3D"m_-55=
63334057486048styled-by-prettify"><br></span><span style=3D"color:#660" cla=
ss=3D"m_-5563334057486048styled-by-prettify">}</span><span style=3D"color:#=
000" class=3D"m_-5563334057486048styled-by-prettify"><br><br></span><span s=
tyle=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">int</sp=
an><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettif=
y"> main</span><span style=3D"color:#660" class=3D"m_-5563334057486048style=
d-by-prettify">()</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"><br></span><span style=3D"color:#660" class=3D"m_-5=
563334057486048styled-by-prettify">{</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 </span><span style=3D=
"color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexpr</spa=
n><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify=
"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-=
prettify">auto</span><span style=3D"color:#000" class=3D"m_-556333405748604=
8styled-by-prettify"> r_0 </span><span style=3D"color:#660" class=3D"m_-556=
3334057486048styled-by-prettify">=3D</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"> func</span><span style=3D"color=
:#660" class=3D"m_-5563334057486048styled-by-prettify">(</span><span style=
=3D"color:#606" class=3D"m_-5563334057486048styled-by-prettify">Literal</sp=
an><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettif=
y">{});</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled=
-by-prettify"> </span><span style=3D"color:#800" class=3D"m_-55633340574860=
48styled-by-prettify">//constexpr(true) version called</span><span style=3D=
"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 </s=
pan><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pretti=
fy">auto</span><span style=3D"color:#000" class=3D"m_-5563334057486048style=
d-by-prettify"> r_1 </span><span style=3D"color:#660" class=3D"m_-556333405=
7486048styled-by-prettify">=3D</span><span style=3D"color:#000" class=3D"m_=
-5563334057486048styled-by-prettify"> func</span><span style=3D"color:#660"=
 class=3D"m_-5563334057486048styled-by-prettify">(</span><font color=3D"#00=
0000"><span style=3D"color:#606" class=3D"m_-5563334057486048styled-by-pret=
tify">Literal</span><span style=3D"color:#660" class=3D"m_-5563334057486048=
styled-by-prettify">{});</span><span style=3D"color:#000" class=3D"m_-55633=
34057486048styled-by-prettify"> </span><span style=3D"color:#800" class=3D"=
m_-5563334057486048styled-by-prettify">//constexpr(false) version called</s=
pan><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-pretti=
fy"><br><br></span></font><span style=3D"color:#000" class=3D"m_-5563334057=
486048styled-by-prettify">=C2=A0 partial_constexpr</span><span style=3D"col=
or:#660" class=3D"m_-5563334057486048styled-by-prettify">(</span><span styl=
e=3D"color:#066" class=3D"m_-5563334057486048styled-by-prettify">42</span><=
span style=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify">/=
*compile-<wbr>time args*/</span><span style=3D"color:#660" class=3D"m_-5563=
334057486048styled-by-prettify">)(</span><span style=3D"color:#800" class=
=3D"m_-5563334057486048styled-by-prettify">/*runtime args*/</span><span sty=
le=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">);</span>=
<span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">=
<br><br>=C2=A0 </span><span style=3D"color:#008" class=3D"m_-55633340574860=
48styled-by-prettify">auto</span><span style=3D"color:#000" class=3D"m_-556=
3334057486048styled-by-prettify"> r_2 </span><span style=3D"color:#660" cla=
ss=3D"m_-5563334057486048styled-by-prettify">=3D</span><span style=3D"color=
:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><span style=
=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexpr</=
span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prett=
ify"> func</span><span style=3D"color:#660" class=3D"m_-5563334057486048sty=
led-by-prettify">(</span><span style=3D"color:#606" class=3D"m_-55633340574=
86048styled-by-prettify">Literal</span><span style=3D"color:#660" class=3D"=
m_-5563334057486048styled-by-prettify">{});</span><span style=3D"color:#000=
" class=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"co=
lor:#800" class=3D"m_-5563334057486048styled-by-prettify">//also proposed u=
nary constexpr operator for explicit selection, error if the expression is =
not constexpr</span><span style=3D"color:#000" class=3D"m_-5563334057486048=
styled-by-prettify"><br>=C2=A0 </span><span style=3D"color:#800" class=3D"m=
_-5563334057486048styled-by-prettify">//is equivalent to</span><span style=
=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =
</span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pre=
ttify">auto</span><span style=3D"color:#000" class=3D"m_-5563334057486048st=
yled-by-prettify"> r_3 </span><span style=3D"color:#660" class=3D"m_-556333=
4057486048styled-by-prettify">=3D</span><span style=3D"color:#000" class=3D=
"m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#660" =
class=3D"m_-5563334057486048styled-by-prettify">[]()</span><span style=3D"c=
olor:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><span st=
yle=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">{</span>=
<span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">=
 </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pr=
ettify">constexpr</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"> </span><span style=3D"color:#008" class=3D"m_-5563=
334057486048styled-by-prettify">auto</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"> __ret__ </span><span style=3D"c=
olor:#660" class=3D"m_-5563334057486048styled-by-prettify">=3D</span><span =
style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> func<=
/span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-pret=
tify">(</span><span style=3D"color:#606" class=3D"m_-5563334057486048styled=
-by-prettify">Literal</span><span style=3D"color:#660" class=3D"m_-55633340=
57486048styled-by-prettify">{});</span><span style=3D"color:#000" class=3D"=
m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#008" c=
lass=3D"m_-5563334057486048styled-by-prettify">return</span><span style=3D"=
color:#000" class=3D"m_-5563334057486048styled-by-prettify"> __ret__</span>=
<span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">=
;</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-pr=
ettify"> </span><span style=3D"color:#660" class=3D"m_-5563334057486048styl=
ed-by-prettify">}();</span><span style=3D"color:#000" class=3D"m_-556333405=
7486048styled-by-prettify"> <br></span><span style=3D"color:#660" class=3D"=
m_-5563334057486048styled-by-prettify">}</span><span style=3D"color:#000" c=
lass=3D"m_-5563334057486048styled-by-prettify"><br><br></span><span style=
=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify">//replacing=
 of gnu&#39;s operator&quot;&quot; extension</span><span style=3D"color:#00=
0" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span style=
=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexpr</=
span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prett=
ify">(</span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-=
by-prettify">true</span><span style=3D"color:#660" class=3D"m_-556333405748=
6048styled-by-prettify">)</span><span style=3D"color:#000" class=3D"m_-5563=
334057486048styled-by-prettify"> </span><span style=3D"color:#008" class=3D=
"m_-5563334057486048styled-by-prettify">auto</span><span style=3D"color:#00=
0" class=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"c=
olor:#008" class=3D"m_-5563334057486048styled-by-prettify">operator</span><=
span style=3D"color:#080" class=3D"m_-5563334057486048styled-by-prettify">&=
quot;&quot;</span><span style=3D"color:#000" class=3D"m_-5563334057486048st=
yled-by-prettify">_string_literal</span><span style=3D"color:#660" class=3D=
"m_-5563334057486048styled-by-prettify">(</span><span style=3D"color:#008" =
class=3D"m_-5563334057486048styled-by-prettify">cons<wbr>t</span><span styl=
e=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><s=
pan style=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">ch=
ar</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-p=
rettify"> </span><span style=3D"color:#660" class=3D"m_-5563334057486048sty=
led-by-prettify">*</span><span style=3D"color:#000" class=3D"m_-55633340574=
86048styled-by-prettify">str</span><span style=3D"color:#660" class=3D"m_-5=
563334057486048styled-by-prettify">,</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"> size_t len</span><span style=3D=
"color:#660" class=3D"m_-5563334057486048styled-by-prettify">)</span><span =
style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br></=
span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prett=
ify">{</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-=
by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#008" class=3D"m=
_-5563334057486048styled-by-prettify">return</span><span style=3D"color:#00=
0" class=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"c=
olor:#660" class=3D"m_-5563334057486048styled-by-prettify">[&amp;]&lt;</spa=
n><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify=
">size_t</span><span style=3D"color:#660" class=3D"m_-5563334057486048style=
d-by-prettify">...</span><span style=3D"color:#000" class=3D"m_-55633340574=
86048styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_-556=
3334057486048styled-by-prettify">Indexs</span><span style=3D"color:#660" cl=
ass=3D"m_-5563334057486048styled-by-prettify">&gt;(</span><span style=3D"co=
lor:#000" class=3D"m_-5563334057486048styled-by-prettify">std</span><span s=
tyle=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">::</spa=
n><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify=
">index_sequence</span><span style=3D"color:#660" class=3D"m_-5563334057486=
048styled-by-prettify">&lt;</span><span style=3D"color:#606" class=3D"m_-55=
63334057486048styled-by-prettify">In<wbr>dexs</span><span style=3D"color:#6=
60" class=3D"m_-5563334057486048styled-by-prettify">...&gt;&amp;&amp;)</spa=
n><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify=
"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660" class=3D"m_-556333405=
7486048styled-by-prettify">{</span><span style=3D"color:#000" class=3D"m_-5=
563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0</span><s=
pan style=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">re=
turn</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by=
-prettify"> </span><font color=3D"#660066"><span style=3D"color:#606" class=
=3D"m_-5563334057486048styled-by-prettify">TemplateCharSeq</span></font><fo=
nt color=3D"#666600"><span style=3D"color:#660" class=3D"m_-556333405748604=
8styled-by-prettify">&lt;</span></font><span style=3D"color:#000" class=3D"=
m_-5563334057486048styled-by-prettify">str</span><span style=3D"color:#660"=
 class=3D"m_-5563334057486048styled-by-prettify">[</span><span style=3D"col=
or:#606" class=3D"m_-5563334057486048styled-by-prettify">Indexs</span><span=
 style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">]...<=
wbr>&gt;{};</span><span style=3D"color:#000" class=3D"m_-5563334057486048st=
yled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660" class=
=3D"m_-5563334057486048styled-by-prettify">}(</span><span style=3D"color:#0=
00" class=3D"m_-5563334057486048styled-by-prettify">std</span><span style=
=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">::</span><s=
pan style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">ma=
ke_index_sequence</span><span style=3D"color:#080" class=3D"m_-556333405748=
6048styled-by-prettify">&lt;<wbr>len&gt;</span><span style=3D"color:#660" c=
lass=3D"m_-5563334057486048styled-by-prettify">{});</span><span style=3D"co=
lor:#000" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span =
style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">}</spa=
n><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify=
"><br><br></span><span style=3D"color:#800" class=3D"m_-5563334057486048sty=
led-by-prettify">//operator[] for std::tuple</span><span style=3D"color:#00=
0" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span style=
=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">template</s=
pan><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-pretti=
fy"> </span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-b=
y-prettify">&lt;</span><span style=3D"color:#008" class=3D"m_-5563334057486=
048styled-by-prettify">class</span><span style=3D"color:#660" class=3D"m_-5=
563334057486048styled-by-prettify">...</span><span style=3D"color:#000" cla=
ss=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#=
606" class=3D"m_-5563334057486048styled-by-prettify">Args</span><span style=
=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">&gt;</span>=
<span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">=
<br></span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by=
-prettify">struct</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"> tuple<br></span><span style=3D"color:#660" class=
=3D"m_-5563334057486048styled-by-prettify">{</span><span style=3D"color:#00=
0" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0</span>=
<span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">=
....</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-=
prettify"><br>=C2=A0 =C2=A0</span><span style=3D"color:#008" class=3D"m_-55=
63334057486048styled-by-prettify">constexpr</span><span style=3D"color:#660=
" class=3D"m_-5563334057486048styled-by-prettify">(</span><span style=3D"co=
lor:#008" class=3D"m_-5563334057486048styled-by-prettify">true</span><span =
style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">)</spa=
n><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify=
"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-=
prettify">auto</span><span style=3D"color:#660" class=3D"m_-556333405748604=
8styled-by-prettify">&amp;</span><span style=3D"color:#000" class=3D"m_-556=
3334057486048styled-by-prettify"> </span><span style=3D"color:#008" class=
=3D"m_-5563334057486048styled-by-prettify">operator</span><span style=3D"co=
lor:#660" class=3D"m_-5563334057486048styled-by-prettify">[](</span><span s=
tyle=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">size_t =
i</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-pr=
ettify">)</span><span style=3D"color:#000" class=3D"m_-5563334057486048styl=
ed-by-prettify"> </span><span style=3D"color:#008" class=3D"m_-556333405748=
6048styled-by-prettify">const</span><span style=3D"color:#000" class=3D"m_-=
5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"=
color:#660" class=3D"m_-5563334057486048styled-by-prettify">{</span><span s=
tyle=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=
=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#008" class=3D"m_-55633340574=
86048styled-by-prettify">static_assert</span><span style=3D"color:#660" cla=
ss=3D"m_-5563334057486048styled-by-prettify">(</span><span style=3D"color:#=
000" class=3D"m_-5563334057486048styled-by-prettify">i </span><span style=
=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">&lt;</span>=
<span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">=
 </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pr=
ettify">sizeof</span><span style=3D"color:#660" class=3D"m_-556333405748604=
8styled-by-prettify">...(</span><span style=3D"color:#606" class=3D"m_-5563=
334057486048styled-by-prettify">Args</span><span style=3D"color:#660" class=
=3D"m_-5563334057486048styled-by-prettify">));</span><span style=3D"color:#=
000" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=
=A0 </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by=
-prettify">return</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"> std</span><span style=3D"color:#660" class=3D"m_-5=
563334057486048styled-by-prettify">::</span><span style=3D"color:#008" clas=
s=3D"m_-5563334057486048styled-by-prettify">get</span><span style=3D"color:=
#080" class=3D"m_-5563334057486048styled-by-prettify">&lt;i&gt;</span><span=
 style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">(*</s=
pan><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pretti=
fy">this</span><span style=3D"color:#660" class=3D"m_-5563334057486048style=
d-by-prettify">);</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"color:#660" =
class=3D"m_-5563334057486048styled-by-prettify">}</span><span style=3D"colo=
r:#000" class=3D"m_-5563334057486048styled-by-prettify"><br><br>=C2=A0 =C2=
=A0</span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-=
prettify">constexpr</span><font color=3D"#000000"><span style=3D"color:#660=
" class=3D"m_-5563334057486048styled-by-prettify">(</span><span style=3D"co=
lor:#008" class=3D"m_-5563334057486048styled-by-prettify">true</span><span =
style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">)</spa=
n><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify=
"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-=
prettify">auto</span><span style=3D"color:#660" class=3D"m_-556333405748604=
8styled-by-prettify">&amp;</span><span style=3D"color:#000" class=3D"m_-556=
3334057486048styled-by-prettify"> </span><span style=3D"color:#008" class=
=3D"m_-5563334057486048styled-by-prettify">operator</span><span style=3D"co=
lor:#660" class=3D"m_-5563334057486048styled-by-prettify">[](</span><span s=
tyle=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">size_t =
i</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-pr=
ettify">)</span><span style=3D"color:#000" class=3D"m_-5563334057486048styl=
ed-by-prettify"><br></span></font><span style=3D"color:#000" class=3D"m_-55=
63334057486048styled-by-prettify">=C2=A0 =C2=A0</span><span style=3D"color:=
#660" class=3D"m_-5563334057486048styled-by-prettify">{</span><span style=
=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 </span><span style=3D"color:#008" class=3D"m_-556333405748604=
8styled-by-prettify">static_assert</span><span style=3D"color:#660" class=
=3D"m_-5563334057486048styled-by-prettify">(</span><span style=3D"color:#00=
0" class=3D"m_-5563334057486048styled-by-prettify">i </span><span style=3D"=
color:#660" class=3D"m_-5563334057486048styled-by-prettify">&lt;</span><spa=
n style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> </s=
pan><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pretti=
fy">sizeof</span><span style=3D"color:#660" class=3D"m_-5563334057486048sty=
led-by-prettify">...(</span><span style=3D"color:#606" class=3D"m_-55633340=
57486048styled-by-prettify">Args</span><span style=3D"color:#660" class=3D"=
m_-5563334057486048styled-by-prettify">));</span><span style=3D"color:#000"=
 class=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 <=
/span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pret=
tify">return</span><span style=3D"color:#000" class=3D"m_-5563334057486048s=
tyled-by-prettify"> std</span><span style=3D"color:#660" class=3D"m_-556333=
4057486048styled-by-prettify">::</span><span style=3D"color:#008" class=3D"=
m_-5563334057486048styled-by-prettify">get</span><span style=3D"color:#080"=
 class=3D"m_-5563334057486048styled-by-prettify">&lt;i&gt;</span><span styl=
e=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">(*</span><=
span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">t=
his</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-=
prettify">);</span><span style=3D"color:#000" class=3D"m_-5563334057486048s=
tyled-by-prettify"> =C2=A0 =C2=A0 =C2=A0<br>=C2=A0 =C2=A0</span><span style=
=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">}</span><sp=
an style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><br=
>=C2=A0 =C2=A0</span><span style=3D"color:#660" class=3D"m_-556333405748604=
8styled-by-prettify">....</span><span style=3D"color:#000" class=3D"m_-5563=
334057486048styled-by-prettify"><br></span><span style=3D"color:#660" class=
=3D"m_-5563334057486048styled-by-prettify">};</span><span style=3D"color:#0=
00" class=3D"m_-5563334057486048styled-by-prettify"><br><br></span><span st=
yle=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">template=
</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-pre=
ttify"> </span><span style=3D"color:#660" class=3D"m_-5563334057486048style=
d-by-prettify">&lt;</span><span style=3D"color:#008" class=3D"m_-5563334057=
486048styled-by-prettify">class</span><span style=3D"color:#660" class=3D"m=
_-5563334057486048styled-by-prettify">...</span><span style=3D"color:#000" =
class=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"colo=
r:#606" class=3D"m_-5563334057486048styled-by-prettify">Args</span><span st=
yle=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">&gt;</sp=
an><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettif=
y"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by=
-prettify">struct</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_-5563=
334057486048styled-by-prettify">Select</span><span style=3D"color:#000" cla=
ss=3D"m_-5563334057486048styled-by-prettify"> </span><font color=3D"#666600=
"><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify=
">:</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-=
prettify"> </span><span style=3D"color:#606" class=3D"m_-5563334057486048st=
yled-by-prettify">Args</span><span style=3D"color:#660" class=3D"m_-5563334=
057486048styled-by-prettify">...</span><span style=3D"color:#000" class=3D"=
m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#660" c=
lass=3D"m_-5563334057486048styled-by-prettify">{</span><span style=3D"color=
:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><span style=
=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">using</span=
><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"=
> </span><span style=3D"color:#606" class=3D"m_-5563334057486048styled-by-p=
rettify">Args</span><span style=3D"color:#660" class=3D"m_-5563334057486048=
styled-by-prettify">::</span><span style=3D"color:#008" class=3D"m_-5563334=
057486048styled-by-prettify">operator</span><span style=3D"color:#660" clas=
s=3D"m_-5563334057486048styled-by-prettify">()...;</span><span style=3D"col=
or:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><span styl=
e=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">};</span><=
span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"><=
br></span></font><span style=3D"color:#008" class=3D"m_-5563334057486048sty=
led-by-prettify">template</span><span style=3D"color:#000" class=3D"m_-5563=
334057486048styled-by-prettify"> </span><span style=3D"color:#660" class=3D=
"m_-5563334057486048styled-by-prettify">&lt;</span><span style=3D"color:#00=
8" class=3D"m_-5563334057486048styled-by-prettify">class</span><span style=
=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">...</span><=
span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> =
</span><span style=3D"color:#606" class=3D"m_-5563334057486048styled-by-pre=
ttify">Args</span><span style=3D"color:#660" class=3D"m_-5563334057486048st=
yled-by-prettify">&gt;</span><span style=3D"color:#000" class=3D"m_-5563334=
057486048styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_=
-5563334057486048styled-by-prettify">Select</span><span style=3D"color:#660=
" class=3D"m_-5563334057486048styled-by-prettify">(</span><span style=3D"co=
lor:#606" class=3D"m_-5563334057486048styled-by-prettify">Args</span><span =
style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">&amp;&=
amp;...)</span><span style=3D"color:#000" class=3D"m_-5563334057486048style=
d-by-prettify"> </span><span style=3D"color:#660" class=3D"m_-5563334057486=
048styled-by-prettify">-&gt;</span><span style=3D"color:#000" class=3D"m_-5=
563334057486048styled-by-prettify"> </span><span style=3D"color:#606" class=
=3D"m_-5563334057486048styled-by-prettify">Select</span><span style=3D"colo=
r:#660" class=3D"m_-5563334057486048styled-by-prettify">&lt;</span><span st=
yle=3D"color:#606" class=3D"m_-5563334057486048styled-by-prettify">Args</sp=
an><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettif=
y">...&gt;;</span><span style=3D"color:#000" class=3D"m_-5563334057486048st=
yled-by-prettify"><br><br></span><span style=3D"color:#800" class=3D"m_-556=
3334057486048styled-by-prettify">//for lambdas</span><span style=3D"color:#=
000" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span style=
=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">void</span>=
<span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">=
 func</span><font color=3D"#666600"><span style=3D"color:#000" class=3D"m_-=
5563334057486048styled-by-prettify">_3</span><span style=3D"color:#660" cla=
ss=3D"m_-5563334057486048styled-by-prettify">()</span><span style=3D"color:=
#000" class=3D"m_-5563334057486048styled-by-prettify"><br></span></font><sp=
an style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">{</=
span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prett=
ify"><br>=C2=A0 </span><span style=3D"color:#008" class=3D"m_-5563334057486=
048styled-by-prettify">constexpr</span><span style=3D"color:#000" class=3D"=
m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#008" c=
lass=3D"m_-5563334057486048styled-by-prettify">auto</span><span style=3D"co=
lor:#000" class=3D"m_-5563334057486048styled-by-prettify"> f_0 </span><span=
 style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">=3D</=
span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prett=
ify"> </span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-=
by-prettify">[]()</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"> </span><span style=3D"color:#660" class=3D"m_-5563=
334057486048styled-by-prettify">{};</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#80=
0" class=3D"m_-5563334057486048styled-by-prettify">//operator() is constexp=
r /*fallback on runtime*/, no changes</span><span style=3D"color:#000" clas=
s=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 </span><span style=
=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexpr</=
span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prett=
ify"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-=
by-prettify">auto</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"> f_1 </span><span style=3D"color:#660" class=3D"m_-=
5563334057486048styled-by-prettify">=3D</span><span style=3D"color:#000" cl=
ass=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:=
#660" class=3D"m_-5563334057486048styled-by-prettify">[]()</span><span styl=
e=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><s=
pan style=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">co=
nstexpr</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled=
-by-prettify">(</span><span style=3D"color:#008" class=3D"m_-55633340574860=
48styled-by-prettify">false</span><span style=3D"color:#660" class=3D"m_-55=
63334057486048styled-by-prettify">)</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#66=
0" class=3D"m_-5563334057486048styled-by-prettify">{};</span><span style=3D=
"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><span =
style=3D"color:#800" class=3D"m_-5563334057486048styled-by-prettify">//oper=
ator() cannot be called at compile-time</span><span style=3D"color:#000" cl=
ass=3D"m_-5563334057486048styled-by-prettify"><br>=C2=A0 </span><span style=
=3D"color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexpr</=
span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prett=
ify"> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-=
by-prettify">auto</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"> f_2 </span><font color=3D"#666600"><span style=3D"=
color:#660" class=3D"m_-5563334057486048styled-by-prettify">=3D</span><span=
 style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> </sp=
an><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettif=
y">[]()</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled=
-by-prettify"> </span><span style=3D"color:#008" class=3D"m_-55633340574860=
48styled-by-prettify">constexpr</span><span style=3D"color:#660" class=3D"m=
_-5563334057486048styled-by-prettify">(</span><span style=3D"color:#008" cl=
ass=3D"m_-5563334057486048styled-by-prettify">true</span><span style=3D"col=
or:#660" class=3D"m_-5563334057486048styled-by-prettify">)</span><span styl=
e=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><s=
pan style=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">{}=
;</span><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-pr=
ettify"> </span><span style=3D"color:#800" class=3D"m_-5563334057486048styl=
ed-by-prettify">//operator() can only be called a compile-time and explicit=
ly</span></font><span style=3D"color:#000" class=3D"m_-5563334057486048styl=
ed-by-prettify"><br><br>=C2=A0 </span><span style=3D"color:#008" class=3D"m=
_-5563334057486048styled-by-prettify">constexpr</span><span style=3D"color:=
#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><font color=
=3D"#000088"><span style=3D"color:#606" class=3D"m_-5563334057486048styled-=
by-prettify">Select</span></font><span style=3D"color:#000" class=3D"m_-556=
3334057486048styled-by-prettify"> f_3 </span><span style=3D"color:#660" cla=
ss=3D"m_-5563334057486048styled-by-prettify">=3D</span><span style=3D"color=
:#000" class=3D"m_-5563334057486048styled-by-prettify"> </span><span style=
=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">{</span><sp=
an style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> f_=
1</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-pr=
ettify">,</span><span style=3D"color:#000" class=3D"m_-5563334057486048styl=
ed-by-prettify"> f_2 </span><span style=3D"color:#660" class=3D"m_-55633340=
57486048styled-by-prettify">};</span><span style=3D"color:#000" class=3D"m_=
-5563334057486048styled-by-prettify"> <br><br>=C2=A0 </span><span style=3D"=
color:#008" class=3D"m_-5563334057486048styled-by-prettify">constexpr</span=
><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"=
> </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-p=
rettify">auto</span><span style=3D"color:#000" class=3D"m_-5563334057486048=
styled-by-prettify"> r_4 </span><span style=3D"color:#660" class=3D"m_-5563=
334057486048styled-by-prettify">=3D</span><span style=3D"color:#000" class=
=3D"m_-5563334057486048styled-by-prettify"> f</span><font color=3D"#666600"=
><span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"=
>_3</span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-=
prettify">();</span><span style=3D"color:#000" class=3D"m_-5563334057486048=
styled-by-prettify"> </span><span style=3D"color:#800" class=3D"m_-55633340=
57486048styled-by-prettify">//f_2</span><span style=3D"color:#000" class=3D=
"m_-5563334057486048styled-by-prettify"><br>=C2=A0 </span><span style=3D"co=
lor:#008" class=3D"m_-5563334057486048styled-by-prettify">auto</span><span =
style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify"> r_5 <=
/span><span style=3D"color:#660" class=3D"m_-5563334057486048styled-by-pret=
tify">=3D</span><span style=3D"color:#000" class=3D"m_-5563334057486048styl=
ed-by-prettify"> f_3</span><span style=3D"color:#660" class=3D"m_-556333405=
7486048styled-by-prettify">();</span><span style=3D"color:#000" class=3D"m_=
-5563334057486048styled-by-prettify"> </span><span style=3D"color:#800" cla=
ss=3D"m_-5563334057486048styled-by-prettify">//f_1</span><span style=3D"col=
or:#000" class=3D"m_-5563334057486048styled-by-prettify"><br></span><span s=
tyle=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">}</span=
></font></div></code></div><div><br></div><div>Here is the summary:</div><d=
iv><br></div><div>- extend constexpr specifier to allow it to take a conste=
xpr explicit bool (no a constexpr expression unless if there are good use-c=
ases for it) where:</div><div><ul><li>constexpr(false) is the default speci=
fier of a function/method</li><ul><li>optional for functions/method.</li><l=
i>if specified with lambdas allows not-constexpr lambda as lambdas are by d=
efault constexpr.</li></ul><li>constexpr(true) is a constexpr only function=
..</li><ul><li>no Assembly representation (no linkage nor mangling).</li><li=
>all arguments are constexpr.</li><li>error if non-constexpr expression is =
used (a constexpr fallback to runtime because of an overflow for instance).=
</li><li>only used in explicit constexpr context.</li><li>cannot be called =
before its specialization if specialization or else error.<br></li></ul><li=
>constexpr</li><ul><li>keeps all its properties and definition.</li><li>wil=
l still trigger redefinition error if previous constexpr(false) version pre=
viously defined.</li><li>constexpr attribute ignored if previous constexpr(=
true) is defined.</li></ul></ul></div><div>- unary constexpr operator to re=
quest a constexpr expression explicitly:</div><div><div class=3D"m_-5563334=
057486048prettyprint" style=3D"background-color:rgb(250,250,250);border-col=
or:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-wor=
d"><code class=3D"m_-5563334057486048prettyprint"><div class=3D"m_-55633340=
57486048subprettyprint"><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify">=C2=A0 =C2=A0</span><span style=3D"color:#008" clas=
s=3D"m_-5563334057486048styled-by-prettify">auto</span><span style=3D"color=
:#000" class=3D"m_-5563334057486048styled-by-prettify"> t </span><span styl=
e=3D"color:#660" class=3D"m_-5563334057486048styled-by-prettify">=3D</span>=
<span style=3D"color:#000" class=3D"m_-5563334057486048styled-by-prettify">=
 </span><span style=3D"color:#008" class=3D"m_-5563334057486048styled-by-pr=
ettify">constexpr</span><span style=3D"color:#000" class=3D"m_-556333405748=
6048styled-by-prettify"> expr</span><span style=3D"color:#660" class=3D"m_-=
5563334057486048styled-by-prettify">;</span><span style=3D"color:#000" clas=
s=3D"m_-5563334057486048styled-by-prettify"> </span><span style=3D"color:#8=
00" class=3D"m_-5563334057486048styled-by-prettify">//might error if expr i=
s no a constexpr expression</span></div></code></div><br>The reason why I b=
elieve in this proposal:</div><div><ul><li>no new keyword.</li><li>zero run=
time impact.</li><li>maintains backward compatibility.</li><li>solves, at l=
east partially, a lot of different proposals.</li></ul><div>Thanks in advan=
ce,</div><div><br></div><div>Bastien Penavayre,</div></div></div><div><a hr=
ef=3D"mailto:bastienPenava@gmail.com" target=3D"_blank">bastienPenava@gmail=
..com</a></div></div><span class=3D"HOEnZb"><font color=3D"#888888">

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/17e156a0-0368-4ec0-a087-e8b4bc8d9f62%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/17e1=
56a0-0368-4ec0-<wbr>a087-e8b4bc8d9f62%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CA%2BfGSbMtnehJhDx3Bz_GfxsqyrK_ch5hes=
7aGZqnufrimtG%3DgQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CA%2BfGSbMtne=
hJhDx3Bz_GfxsqyrK_ch5hes7aGZqnufrimtG%3DgQ%40mail.gmail.com</a>.<br />

--94eb2c1fb964f4ccea05581255cf--

.
