Topic: constexpr only functions: arbitrary literal types


Author: Ricardo Fabiano de Andrade <ricardofabianodeandrade@gmail.com>
Date: Thu, 31 Aug 2017 15:17:37 -0500
Raw View
--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--

.


Author: Bastien Penavayre <swac31@gmail.com>
Date: Thu, 31 Aug 2017 14:32:27 -0700 (PDT)
Raw View
------=_Part_949_1258920723.1504215147232
Content-Type: multipart/alternative;
 boundary="----=_Part_950_1368746726.1504215147233"

------=_Part_950_1368746726.1504215147233
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Le jeudi 31 ao=C3=BBt 2017 22:17:41 UTC+2, Ricardo Andrade a =C3=A9crit :
>
> Very interesting proposal. Looking forward to hearing additional feedback=
=20
> from others, I hope it moves forward.
>
Thanks.

> Simple syntax question: why not placing constexpr() next to where=20
> noexcept() is, at the end of the function declaration/definition?
>
That's a good question. I'm not opposed to the idea but my motivation was=
=20
the following:

To make as little change as possible to the existing grammar.
As of now constexpr is a front specifier for function/members, tail=20
specifier for lambdas and syntactically I'm only expending it, i'm not=20
creating something new.
auto func() constexpr; //invalid now

 | This alternative seems more consistent, even with lambda functions=20
examples.
You can notice that it's the case with the lambdas in my exemple and I=20
agree,
but for now lambdas and functions/methods don't have the same syntax to=20
express their constexpr-ness.
A Proposal to correct this wouldn't be affected by this proposal.

On a more design oriented front, as constexpr would allow "specialization"=
=20
I feel like it's not a bad idea to put it at the front of the function, to=
=20
make it more visible.

I hope I've answered your question correctly.
If you have any other, please, feel free to ask.

--=20
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 e=
mail 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/635c6793-0bb8-4407-b890-04ab33d1fe8b%40isocpp.or=
g.

------=_Part_950_1368746726.1504215147233
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Le jeudi 31 ao=C3=BBt 2017 22:17:41 UTC+2, Ricardo Andrade=
 a =C3=A9crit=C2=A0:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr">Very interesting proposal. Looking forward to hearing additional f=
eedback from others, I hope it moves forward.</div></blockquote><div>Thanks=
..</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.=
8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>S=
imple syntax question: why not placing constexpr() next to where noexcept()=
 is, at the end of the function declaration/definition?</div></div></blockq=
uote><div>That&#39;s a good question. I&#39;m not opposed to the idea but m=
y motivation was the following:</div><div><br></div><div>To make as little =
change as possible to the existing grammar.<br>As of now constexpr is a fro=
nt specifier for function/members, tail specifier for lambdas and syntactic=
ally I&#39;m only expending it, i&#39;m not creating something new.<br><div=
 class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); borde=
r-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; word-w=
rap: break-word;"><code class=3D"prettyprint"><div class=3D"subprettyprint"=
><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> func</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">constexpr</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-b=
y-prettify">//invalid now</span></div></code></div><span class=3D"styled-by=
-prettify" style=3D"background-color: rgb(250, 250, 250); color: rgb(136, 0=
, 0);"><br></span></div><div>=C2=A0| This alternative seems more consistent=
, even with lambda functions examples.</div><div>You can notice that it&#39=
;s the case with the lambdas in my exemple and I agree,</div><div>but for n=
ow lambdas and functions/methods don&#39;t have the same syntax to express =
their constexpr-ness.</div><div>A Proposal to correct this wouldn&#39;t be =
affected by this proposal.</div><div><br></div><div>On a more design orient=
ed front, as constexpr would allow &quot;specialization&quot; I feel like i=
t&#39;s not a bad idea to put it at the front of the function, to make it m=
ore visible.</div><div><br></div><div>I hope I&#39;ve answered your questio=
n correctly.</div><div>If you have any other, please, feel free to ask.</di=
v></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/635c6793-0bb8-4407-b890-04ab33d1fe8b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/635c6793-0bb8-4407-b890-04ab33d1fe8b=
%40isocpp.org</a>.<br />

------=_Part_950_1368746726.1504215147233--

------=_Part_949_1258920723.1504215147232--

.


Author: Ricardo Fabiano de Andrade <ricardofabianodeandrade@gmail.com>
Date: Thu, 31 Aug 2017 17:22:49 -0500
Raw View
--001a1140c1d6ac68370558141507
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 31, 2017 at 4:32 PM, Bastien Penavayre <swac31@gmail.com> wrote=
:

> Le jeudi 31 ao=C3=BBt 2017 22:17:41 UTC+2, Ricardo Andrade a =C3=A9crit :
>>
>> Very interesting proposal. Looking forward to hearing additional feedbac=
k
>> from others, I hope it moves forward.
>>
> Thanks.
>
>> Simple syntax question: why not placing constexpr() next to where
>> noexcept() is, at the end of the function declaration/definition?
>>
> That's a good question. I'm not opposed to the idea but my motivation was
> the following:
>
> To make as little change as possible to the existing grammar.
> As of now constexpr is a front specifier for function/members, tail
> specifier for lambdas and syntactically I'm only expending it, i'm not
> creating something new.
> auto func() constexpr; //invalid now
>
>  | This alternative seems more consistent, even with lambda functions
> examples.
> You can notice that it's the case with the lambdas in my exemple and I
> agree,
> but for now lambdas and functions/methods don't have the same syntax to
> express their constexpr-ness.
> A Proposal to correct this wouldn't be affected by this proposal.
>
> On a more design oriented front, as constexpr would allow "specialization=
"
> I feel like it's not a bad idea to put it at the front of the function, t=
o
> make it more visible.
>
> I hope I've answered your question correctly.
> If you have any other, please, feel free to ask.
>

I was interested in the motivation behind your choice and after the
explanation I am more open to it.
I'll be following the thread.

> --
> 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/635c6793-0bb8-4407-
> b890-04ab33d1fe8b%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/635c6793-0b=
b8-4407-b890-04ab33d1fe8b%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>

--=20
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 e=
mail 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%2BfGSbMS_aR8n6MSaRHNYh6vO%2BWxtb4KiKnWs9t2Avr=
E9otE%3Dw%40mail.gmail.com.

--001a1140c1d6ac68370558141507
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>On Thu, Aug 31, 2017 at 4:32 PM, Bastien Penavayre <s=
pan dir=3D"ltr">&lt;<a href=3D"mailto:swac31@gmail.com" target=3D"_blank">s=
wac31@gmail.com</a>&gt;</span> wrote:<br></div><div><div class=3D"gmail_ext=
ra"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left=
:1ex"><div dir=3D"ltr">Le jeudi 31 ao=C3=BBt 2017 22:17:41 UTC+2, Ricardo A=
ndrade a =C3=A9crit=C2=A0:<blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
><div dir=3D"ltr">Very interesting proposal. Looking forward to hearing add=
itional feedback from others, I hope it moves forward.</div></blockquote><d=
iv>Thanks.</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=
=3D"ltr"><div>Simple syntax question: why not placing constexpr() next to w=
here noexcept() is, at the end of the function declaration/definition?</div=
></div></blockquote><div>That&#39;s a good question. I&#39;m not opposed to=
 the idea but my motivation was the following:</div><div><br></div><div>To =
make as little change as possible to the existing grammar.<br>As of now con=
stexpr is a front specifier for function/members, tail specifier for lambda=
s and syntactically I&#39;m only expending it, i&#39;m not creating somethi=
ng new.<br><div class=3D"gmail-m_5290521880339823116prettyprint" style=3D"b=
ackground-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style=
:solid;border-width:1px;word-wrap:break-word"><code class=3D"gmail-m_529052=
1880339823116prettyprint"><div class=3D"gmail-m_5290521880339823116subprett=
yprint"><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_529052188033982=
3116styled-by-prettify">auto</span><span style=3D"color:rgb(0,0,0)" class=
=3D"gmail-m_5290521880339823116styled-by-prettify"> func</span><span style=
=3D"color:rgb(102,102,0)" class=3D"gmail-m_5290521880339823116styled-by-pre=
ttify">()</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_529052188=
0339823116styled-by-prettify"> </span><span style=3D"color:rgb(0,0,136)" cl=
ass=3D"gmail-m_5290521880339823116styled-by-prettify">constexpr</span><span=
 style=3D"color:rgb(102,102,0)" class=3D"gmail-m_5290521880339823116styled-=
by-prettify">;</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_5290=
521880339823116styled-by-prettify"> </span><span style=3D"color:rgb(136,0,0=
)" class=3D"gmail-m_5290521880339823116styled-by-prettify">//invalid now</s=
pan></div></code></div><span class=3D"gmail-m_5290521880339823116styled-by-=
prettify" style=3D"background-color:rgb(250,250,250);color:rgb(136,0,0)"><b=
r></span></div><div>=C2=A0| This alternative seems more consistent, even wi=
th lambda functions examples.</div><div>You can notice that it&#39;s the ca=
se with the lambdas in my exemple and I agree,</div><div>but for now lambda=
s and functions/methods don&#39;t have the same syntax to express their con=
stexpr-ness.</div><div>A Proposal to correct this wouldn&#39;t be affected =
by this proposal.</div><div><br></div><div>On a more design oriented front,=
 as constexpr would allow &quot;specialization&quot; I feel like it&#39;s n=
ot a bad idea to put it at the front of the function, to make it more visib=
le.</div><div><br></div><div>I hope I&#39;ve answered your question correct=
ly.</div><div>If you have any other, please, feel free to ask.</div></div><=
/blockquote><div><br></div><div>I was interested in the motivation behind y=
our choice and after the explanation I am more open to it.</div><div>I&#39;=
ll be following the thread.</div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex"><span class=3D"gmail-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/635c6793-0bb8-4407-b890-04ab33d1fe8b%=
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/635c=
6793-0bb8-4407-<wbr>b890-04ab33d1fe8b%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></div></div></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%2BfGSbMS_aR8n6MSaRHNYh6vO%2BWxtb4K=
iKnWs9t2AvrE9otE%3Dw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CA%2BfGSbMS=
_aR8n6MSaRHNYh6vO%2BWxtb4KiKnWs9t2AvrE9otE%3Dw%40mail.gmail.com</a>.<br />

--001a1140c1d6ac68370558141507--

.


Author: Bastien Penavayre <swac31@gmail.com>
Date: Fri, 15 Sep 2017 02:31:05 -0700 (PDT)
Raw View
------=_Part_903_1526549714.1505467865071
Content-Type: multipart/alternative;
 boundary="----=_Part_904_1162844812.1505467865074"

------=_Part_904_1162844812.1505467865074
Content-Type: text/plain; charset="UTF-8"


>
> Hi,
>
I've formulated this idea a while ago now but I haven't gathered much
feedback.
My idea is to allow constexpr specialization without impeding on existant
constexpr rules by allowing constexpr to take a bool literal a la noexcept.
The reason as to why is that It would allow to answer the demand for
arbitrary literal types for non-type template parameter, constexpr
arguments in function, is_constexpr, gnu string literal operator,
operator[] for std::tuple and would lead in general to cleaner code.
And all of that without new keyword, mangling problems, etc...

There are a bunch of proposals floating around, that, I think, are
> interesting but have issues implementation-wise.
> *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, may warn
constexpr auto func2();

constexpr auto func3();
constexpr auto error_0 = func3();
//error: 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 [/*no capture required as constant is constexpr*/](auto&&...
runtime_args) constexpr /*normal constexpr lambda*/
   {
       //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/7978cd34-ff03-4903-88d6-00c3fbd68119%40isocpp.org.

------=_Part_904_1162844812.1505467865074
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr">Hi, =C2=A0</div></blockquote><div>I&#39;ve formulated this idea a while=
 ago now but I haven&#39;t gathered much feedback.</div><div>My idea is to =
allow constexpr specialization without impeding on existant constexpr rules=
 by allowing constexpr to take a bool literal a la noexcept.</div><div>The =
reason as to why is that It would allow to answer the demand for arbitrary =
literal types for non-type template parameter, constexpr arguments in funct=
ion, is_constexpr, gnu string literal operator, operator[] for std::tuple a=
nd would lead in general to cleaner code.</div><div>And all of that without=
 new keyword, mangling problems, etc...</div><div><br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #=
ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><div>There are a bunch =
of proposals floating around, that, I think, are interesting but have issue=
s implementation-wise.</div><div><font style=3D"font-family:arial,sans-seri=
f;color:rgb(0,0,0)" size=3D"2"><b style=3D"font-style:italic">N3413</b> (</=
font><font color=3D"#000000" face=3D"arial, sans-serif"><font size=3D"2">ar=
bitrary literal types for non-type)</font><font size=3D"2" style=3D"font-st=
yle:italic;font-weight:bold">=C2=A0</font><font size=3D"2">f</font></font><=
font style=3D"font-family:arial,sans-serif"><font color=3D"#000000">or inst=
ance requires=C2=A0that a bunch of controversial questions to be answered t=
o be accepted (mangling, operator=3D=3D or bitwise, ...).</font></font></di=
v><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">A=
t the same time demands to check or enforce constexpr-ness in functions wer=
e made through the ideas of <b><i>forced 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 a=
rguments be integrated into the mangling of the function, making this propo=
sal syntax sugar to <b><i>N3413</i></b>.</li></ul></div><div><div style=3D"=
background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-styl=
e:solid;border-width:1px;word-wrap:break-word"><code><div><span style=3D"co=
lor:#800">//this</span><span style=3D"color:#000"><br></span><span style=3D=
"color:#008">template</span><span style=3D"color:#660">&lt;</span><span sty=
le=3D"color:#606">Literal</span><span style=3D"color:#000"> l</span><span s=
tyle=3D"color:#660">&gt;</span><span style=3D"color:#000"> </span><span sty=
le=3D"color:#008">void</span><span style=3D"color:#000"> func</span><span s=
tyle=3D"color:#660">();</span><span style=3D"color:#000"><br></span><span s=
tyle=3D"color:#800">//differs only through call syntax from this</span><spa=
n style=3D"color:#000"><br></span><span style=3D"color:#008">void</span><sp=
an style=3D"color:#000"> func</span><span style=3D"color:#660">(</span><spa=
n style=3D"color:#008">constexpr</span><span style=3D"color:#000"> </span><=
span style=3D"color:#606">Literal</span><span style=3D"color:#000"> l</span=
><span style=3D"color:#660">);</span><span style=3D"color:#000"><br><br></s=
pan><span style=3D"color:#800">//yet this would allow to get rid of atrocio=
us code like this</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#008">template</span><span style=3D"color:#660">&lt;</span><span =
style=3D"color:#008">auto</span><font color=3D"#000088"><span style=3D"colo=
r:#000"> I</span><span style=3D"color:#660">&gt;</span><span style=3D"color=
:#000"><br></span><span style=3D"color:#008">constexpr</span><span style=3D=
"color:#000"> </span><span style=3D"color:#008">auto</span><span style=3D"c=
olor:#000"> func</span><span style=3D"color:#660">(</span><span style=3D"co=
lor:#000">std</span><span style=3D"color:#660">:</span><span style=3D"color=
:#000">integral_constant</span><span style=3D"color:#660">&lt;</span><span =
style=3D"color:#008">dec<wbr>ltype</span><span style=3D"color:#660">(</span=
><span style=3D"color:#000">I</span><span style=3D"color:#660">),</span><sp=
an style=3D"color:#000"> I</span><span style=3D"color:#660">&gt;);</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#800">//only uses I</=
span><span style=3D"color:#000"><br></span></font></div></code></div></div>=
<div><ul><li>=C2=A0 =C2=A0The latter (<i><b>is_constexpr</b></i>) aims to a=
llow a runtime or compile-time specialization<font color=3D"#000000" face=
=3D"arial, sans-serif">=C2=A0through a constexpr expression with a variant =
value. It would requires long </font><i style=3D"font-size:small;color:rgb(=
0,0,0);font-family:arial,sans-serif">if constexpr </i><span style=3D"font-s=
ize:small;color:rgb(0,0,0);font-family:arial,sans-serif">blocks</span><i st=
yle=3D"font-size:small;color:rgb(0,0,0);font-family:arial,sans-serif">=C2=
=A0</i><span style=3D"font-size:small;color:rgb(0,0,0);font-family:arial,sa=
ns-serif">as, if runtime specialization is required, we can assume that the=
 runtime and compile-time version will share very little code. It=C2=A0</sp=
an><font color=3D"#000000" face=3D"arial, sans-serif">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=C2=
=A0to use those as such or would require that <i><b>if constexp(is_constexp=
r()) </b></i>have side-effects (big no-no).</font><br></li></ul></div><div =
style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);bo=
rder-style:solid;border-width:1px;word-wrap:break-word"><code><div><span st=
yle=3D"color:#008">constexpr</span><span style=3D"color:#000"> </span><span=
 style=3D"color:#008">auto</span><span style=3D"color:#000"> func</span><sp=
an style=3D"color:#660">(</span><span style=3D"color:#008">int</span><span =
style=3D"color:#000"> i</span><span style=3D"color:#660">)</span><span styl=
e=3D"color:#000"><br></span><span style=3D"color:#660">{</span><span style=
=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#008">=
if</span><span style=3D"color:#000"> </span><span style=3D"color:#008">cons=
texpr</span><span style=3D"color:#000"> </span><span style=3D"color:#660">(=
</span><span style=3D"color:#000">is_constexpr</span><span style=3D"color:#=
660">())</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 </span><=
span style=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#800">//i is still not=
 usable as a constexpr</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#800">//long piece of code=
 or call to other function that handles the compile-time version</span><spa=
n style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span>=
<span style=3D"color:#660">...</span><span style=3D"color:#000"><br>=C2=A0 =
=C2=A0 =C2=A0 </span><span style=3D"color:#660">}</span><span style=3D"colo=
r:#000"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#008">else</sp=
an><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=
=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 </span><span style=3D"color:#800">//long piece of code or ca=
ll to other function that handles the runtime version</span><span style=3D"=
color:#000"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=
=3D"color:#660">....</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=
=A0 </span><span style=3D"color:#660">}</span><span style=3D"color:#000"><b=
r></span><span style=3D"color:#660">}</span><span style=3D"color:#000"><br>=
</span></div></code></div><div><br></div><div>Now that the context has been=
 presented here is my proposal with a detailed and commented exemple.</div>=
<div>My goal is to allow a big chunk of what the other proposal aimed to al=
low 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> synta=
x.</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 style=3D"ba=
ckground-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:=
solid;border-width:1px;word-wrap:break-word"><code><div><span style=3D"colo=
r:#800"></span></div></code></div></div></div></blockquote><div class=3D"pr=
ettyprint" style=3D"border-color: rgb(187, 187, 187); border-style: solid; =
border-width: 1px; word-wrap: break-word;"><div class=3D"subprettyprint" st=
yle=3D""><code class=3D"prettyprint"><span style=3D"background-color: rgb(2=
50, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//compi=
le-time only function</span><span style=3D"background-color: rgb(250, 250, =
250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><span s=
tyle=3D"background-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=
=3D"styled-by-prettify">//it will never have linkage</span><span style=3D"b=
ackground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-=
by-prettify"><br></span><span style=3D"background-color: rgb(250, 250, 250)=
; color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//all its arguments =
are constexpr</span><span style=3D"background-color: rgb(250, 250, 250); co=
lor: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><span style=3D"=
background-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"styl=
ed-by-prettify">//a non-constexpr expression usage in its definition will c=
ause an error instead of a fallback like normal constexpr</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"><br></span><span style=3D"background-color: rgb(250, 250,=
 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//is only calle=
d in an explicit constexpr context unlike normal constexpr</span><span styl=
e=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"s=
tyled-by-prettify"><br></span><span style=3D"background-color: rgb(250, 250=
, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">constexpr</spa=
n><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102,=
 0);" class=3D"styled-by-prettify">(</span><span style=3D"background-color:=
 rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">t=
rue</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(1=
02, 102, 0);" class=3D"styled-by-prettify">)</span><span style=3D"backgroun=
d-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prett=
ify"> </span><span style=3D"background-color: rgb(250, 250, 250); color: rg=
b(0, 0, 136);" class=3D"styled-by-prettify">auto</span><span style=3D"backg=
round-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-p=
rettify"> func</span><span style=3D"background-color: rgb(250, 250, 250); c=
olor: rgb(102, 102, 0);" class=3D"styled-by-prettify">(</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(102, 0, 102);" class=
=3D"styled-by-prettify">Literal</span><span style=3D"background-color: rgb(=
250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> r</span=
><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, =
0);" class=3D"styled-by-prettify">);</span><span style=3D"background-color:=
 rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br=
><br></span><span style=3D"background-color: rgb(250, 250, 250); color: rgb=
(136, 0, 0);" class=3D"styled-by-prettify">//runtime specialization of func=
</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0=
, 0);" class=3D"styled-by-prettify"><br></span><span style=3D"background-co=
lor: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettif=
y">/*constexpr(false)*/</span><span style=3D"background-color: rgb(250, 250=
, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span st=
yle=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=
=3D"styled-by-prettify">auto</span><span style=3D"background-color: rgb(250=
, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> func</span=
><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, =
0);" class=3D"styled-by-prettify">(</span><span style=3D"background-color: =
rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prettify">=
Literal</span><span style=3D"background-color: rgb(250, 250, 250); color: r=
gb(0, 0, 0);" class=3D"styled-by-prettify"> r</span><span style=3D"backgrou=
nd-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-=
prettify">);</span><span style=3D"background-color: rgb(250, 250, 250); col=
or: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"back=
ground-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-b=
y-prettify">//constexpr(false) is the default for functions and methods</sp=
an><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0)=
;" class=3D"styled-by-prettify"><br><br></span><span style=3D"background-co=
lor: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettif=
y">//error redefinition of &#39;constexpr(false) void func(Literal)&#39;</s=
pan><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0=
);" class=3D"styled-by-prettify"><br></span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">=
constexpr</span><span style=3D"background-color: rgb(250, 250, 250); color:=
 rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"backgro=
und-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-p=
rettify">void</span><span style=3D"background-color: rgb(250, 250, 250); co=
lor: rgb(0, 0, 0);" class=3D"styled-by-prettify"> func</span><span style=3D=
"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"s=
tyled-by-prettify">();</span><span style=3D"background-color: rgb(250, 250,=
 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br><br></span><s=
pan style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" =
class=3D"styled-by-prettify">constexpr</span><span style=3D"background-colo=
r: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettif=
y">(</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(=
0, 0, 136);" class=3D"styled-by-prettify">true</span><span style=3D"backgro=
und-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by=
-prettify">)</span><span style=3D"background-color: rgb(250, 250, 250); col=
or: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"back=
ground-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-b=
y-prettify">auto</span><span style=3D"background-color: rgb(250, 250, 250);=
 color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> func2</span><span styl=
e=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">();</span><span style=3D"background-color: rgb(250,=
 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(136, 0, 0);"=
 class=3D"styled-by-prettify">//allowed</span><span style=3D"background-col=
or: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify">=
<br></span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(=
136, 0, 0);" class=3D"styled-by-prettify">//constexpr is ignored, retains i=
nline side effect, may warn</span><span style=3D"background-color: rgb(250,=
 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);"=
 class=3D"styled-by-prettify">constexpr</span><span style=3D"background-col=
or: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify">=
 </span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, =
0, 136);" class=3D"styled-by-prettify">auto</span><span style=3D"background=
-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pretti=
fy"> func2</span><span style=3D"background-color: rgb(250, 250, 250); color=
: rgb(102, 102, 0);" class=3D"styled-by-prettify">();</span><span style=3D"=
background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled=
-by-prettify"><br><br></span><span style=3D"background-color: rgb(250, 250,=
 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">constexpr</span=
><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);"=
 class=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(=
250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">auto</=
span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, =
0);" class=3D"styled-by-prettify"> func3</span><span style=3D"background-co=
lor: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prett=
ify">();</span><span style=3D"background-color: rgb(250, 250, 250); color: =
rgb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><span style=3D"backg=
round-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by=
-prettify">constexpr</span><span style=3D"background-color: rgb(250, 250, 2=
50); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"=
styled-by-prettify">auto</span><span style=3D"background-color: rgb(250, 25=
0, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> error_0 </span=
><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, =
0);" class=3D"styled-by-prettify">=3D</span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> f=
unc3</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(=
102, 102, 0);" class=3D"styled-by-prettify">();</span><span style=3D"backgr=
ound-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pr=
ettify"><br></span><span style=3D"background-color: rgb(250, 250, 250); col=
or: rgb(136, 0, 0);" class=3D"styled-by-prettify">//error: constexpr specia=
lization of &#39;func3&#39; after instanciation</span><span style=3D"backgr=
ound-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pr=
ettify"><br></span><span style=3D"background-color: rgb(250, 250, 250); col=
or: rgb(0, 0, 136);" class=3D"styled-by-prettify">constexpr</span><span sty=
le=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">(</span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">true</span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0)=
;" class=3D"styled-by-prettify">)</span><span style=3D"background-color: rg=
b(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </spa=
n><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136=
);" class=3D"styled-by-prettify">auto</span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> f=
unc3</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(=
102, 102, 0);" class=3D"styled-by-prettify">();</span><span style=3D"backgr=
ound-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pr=
ettify"><br><br></span><span style=3D"background-color: rgb(250, 250, 250);=
 color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//addresses demands f=
or partially constexpr argument-list</span><span style=3D"background-color:=
 rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br=
></span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, =
0, 136);" class=3D"styled-by-prettify">constexpr</span><span style=3D"backg=
round-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-=
by-prettify">(</span><span style=3D"background-color: rgb(250, 250, 250); c=
olor: rgb(0, 0, 136);" class=3D"styled-by-prettify">true</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">)</span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span =
style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" clas=
s=3D"styled-by-prettify">void</span><span style=3D"background-color: rgb(25=
0, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> partial_c=
onstexpr</span><span style=3D"background-color: rgb(250, 250, 250); color: =
rgb(102, 102, 0);" class=3D"styled-by-prettify">(</span><span style=3D"back=
ground-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-b=
y-prettify">int</span><span style=3D"background-color: rgb(250, 250, 250); =
color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> constant</span><span st=
yle=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" clas=
s=3D"styled-by-prettify">)</span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><s=
pan style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);=
" class=3D"styled-by-prettify">{</span><span style=3D"background-color: rgb=
(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0</span><span style=3D"background-color: rgb(250, 250, 250); color=
: rgb(0, 0, 136);" class=3D"styled-by-prettify">return</span><span style=3D=
"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"style=
d-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, 250);=
 color: rgb(102, 102, 0);" class=3D"styled-by-prettify">[/*no capture requi=
red as constant is constexpr*/](</span><span style=3D"background-color: rgb=
(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">auto<=
/span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, =
102, 0);" class=3D"styled-by-prettify">&amp;&amp;...</span><span style=3D"b=
ackground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-=
by-prettify"> runtime_args</span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">)</span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" c=
lass=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(25=
0, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">constexp=
r=C2=A0</span><span style=3D"background-color: rgb(250, 250, 250); color: r=
gb(136, 0, 0);" class=3D"styled-by-prettify">/*normal constexpr lambda*/<br=
></span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102=
, 102, 0);" class=3D"styled-by-prettify">=C2=A0 =C2=A0{</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D"back=
ground-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-b=
y-prettify">//runtime code</span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0</span><span style=3D"background-color: rgb(250, 250, 2=
50); color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//can use &#39;co=
nstant&#39; as a constexpr here</span><span style=3D"background-color: rgb(=
250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0</span><span style=3D"background-color: rgb(250, 250, 250); color=
: rgb(102, 102, 0);" class=3D"styled-by-prettify">};</span><span style=3D"b=
ackground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-=
by-prettify"><br></span><span style=3D"background-color: rgb(250, 250, 250)=
; color: rgb(102, 102, 0);" class=3D"styled-by-prettify">}</span><span styl=
e=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"s=
tyled-by-prettify"><br><br></span><span style=3D"background-color: rgb(250,=
 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">int</span>=
<span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" =
class=3D"styled-by-prettify"> main</span><span style=3D"background-color: r=
gb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">(=
)</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, =
0, 0);" class=3D"styled-by-prettify"><br></span><span style=3D"background-c=
olor: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-pret=
tify">{</span><span style=3D"background-color: rgb(250, 250, 250); color: r=
gb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D=
"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"sty=
led-by-prettify">constexpr</span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span=
 style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" cla=
ss=3D"styled-by-prettify">auto</span><span style=3D"background-color: rgb(2=
50, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> r_0 </sp=
an><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102=
, 0);" class=3D"styled-by-prettify">=3D</span><span style=3D"background-col=
or: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify">=
 func</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb=
(102, 102, 0);" class=3D"styled-by-prettify">(</span><span style=3D"backgro=
und-color: rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by=
-prettify">Literal</span><span style=3D"background-color: rgb(250, 250, 250=
); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{});</span><span =
style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=
=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//constexpr(=
true) version called</span><span style=3D"background-color: rgb(250, 250, 2=
50); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 </span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);"=
 class=3D"styled-by-prettify">auto</span><span style=3D"background-color: r=
gb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> r_1 =
</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102,=
 102, 0);" class=3D"styled-by-prettify">=3D</span><span style=3D"background=
-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pretti=
fy"> func</span><span style=3D"background-color: rgb(250, 250, 250); color:=
 rgb(102, 102, 0);" class=3D"styled-by-prettify">(</span><span style=3D"bac=
kground-color: rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"style=
d-by-prettify">Literal</span><span style=3D"background-color: rgb(250, 250,=
 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{});</span><s=
pan style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(250=
, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//constex=
pr(false) version called</span><span style=3D"background-color: rgb(250, 25=
0, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br><br>=C2=A0 =
partial_constexpr</span><span style=3D"background-color: rgb(250, 250, 250)=
; color: rgb(102, 102, 0);" class=3D"styled-by-prettify">(</span><span styl=
e=3D"background-color: rgb(250, 250, 250); color: rgb(0, 102, 102);" class=
=3D"styled-by-prettify">42</span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettify">/*compile-t=
ime args*/</span><span style=3D"background-color: rgb(250, 250, 250); color=
: rgb(102, 102, 0);" class=3D"styled-by-prettify">)(</span><span style=3D"b=
ackground-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"style=
d-by-prettify">/*runtime args*/</span><span style=3D"background-color: rgb(=
250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">);</=
span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, =
0);" class=3D"styled-by-prettify"><br><br>=C2=A0 </span><span style=3D"back=
ground-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-b=
y-prettify">auto</span><span style=3D"background-color: rgb(250, 250, 250);=
 color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> r_2 </span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">=3D</span><span style=3D"background-color: rgb(250,=
 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><spa=
n style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" cl=
ass=3D"styled-by-prettify">constexpr</span><span style=3D"background-color:=
 rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> fu=
nc</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(10=
2, 102, 0);" class=3D"styled-by-prettify">(</span><span style=3D"background=
-color: rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-pr=
ettify">Literal</span><span style=3D"background-color: rgb(250, 250, 250); =
color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{});</span><span sty=
le=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"=
styled-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, =
250); color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//also proposed =
unary constexpr operator for explicit selection, error if the expression is=
 not constexpr</span><span style=3D"background-color: rgb(250, 250, 250); c=
olor: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 </span><span s=
tyle=3D"background-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=
=3D"styled-by-prettify">//is equivalent to</span><span style=3D"background-=
color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettif=
y"><br>=C2=A0 </span><span style=3D"background-color: rgb(250, 250, 250); c=
olor: rgb(0, 0, 136);" class=3D"styled-by-prettify">auto</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"> r_3 </span><span style=3D"background-color: rgb(250, 250=
, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">=3D</span><s=
pan style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(250=
, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">[]()</s=
pan><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0=
);" class=3D"styled-by-prettify"> </span><span style=3D"background-color: r=
gb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{=
</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0=
, 0);" class=3D"styled-by-prettify"> </span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">=
constexpr</span><span style=3D"background-color: rgb(250, 250, 250); color:=
 rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"backgro=
und-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-p=
rettify">auto</span><span style=3D"background-color: rgb(250, 250, 250); co=
lor: rgb(0, 0, 0);" class=3D"styled-by-prettify"> __ret__ </span><span styl=
e=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">=3D</span><span style=3D"background-color: rgb(250,=
 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> func</span>=
<span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0=
);" class=3D"styled-by-prettify">(</span><span style=3D"background-color: r=
gb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prettify">L=
iteral</span><span style=3D"background-color: rgb(250, 250, 250); color: rg=
b(102, 102, 0);" class=3D"styled-by-prettify">{});</span><span style=3D"bac=
kground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by=
-prettify"> </span><span style=3D"background-color: rgb(250, 250, 250); col=
or: rgb(0, 0, 136);" class=3D"styled-by-prettify">return</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"> __ret__</span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">;</span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" c=
lass=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(25=
0, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">}();</=
span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, =
0);" class=3D"styled-by-prettify"> <br></span><span style=3D"background-col=
or: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-pretti=
fy">}</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb=
(0, 0, 0);" class=3D"styled-by-prettify"><br><br></span><span style=3D"back=
ground-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-b=
y-prettify">//replacing of gnu&#39;s operator&quot;&quot; extension</span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" c=
lass=3D"styled-by-prettify"><br></span><span style=3D"background-color: rgb=
(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">const=
expr</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(=
102, 102, 0);" class=3D"styled-by-prettify">(</span><span style=3D"backgrou=
nd-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-pr=
ettify">true</span><span style=3D"background-color: rgb(250, 250, 250); col=
or: rgb(102, 102, 0);" class=3D"styled-by-prettify">)</span><span style=3D"=
background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled=
-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, 250); =
color: rgb(0, 0, 136);" class=3D"styled-by-prettify">auto</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, 25=
0); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">operator</span><sp=
an style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 136, 0);" c=
lass=3D"styled-by-prettify">&quot;&quot;</span><span style=3D"background-co=
lor: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"=
>_string_literal</span><span style=3D"background-color: rgb(250, 250, 250);=
 color: rgb(102, 102, 0);" class=3D"styled-by-prettify">(</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"=
styled-by-prettify">const</span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span =
style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" clas=
s=3D"styled-by-prettify">char</span><span style=3D"background-color: rgb(25=
0, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><s=
pan style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);=
" class=3D"styled-by-prettify">*</span><span style=3D"background-color: rgb=
(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify">str</sp=
an><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102=
, 0);" class=3D"styled-by-prettify">,</span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> s=
ize_t len</span><span style=3D"background-color: rgb(250, 250, 250); color:=
 rgb(102, 102, 0);" class=3D"styled-by-prettify">)</span><span style=3D"bac=
kground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by=
-prettify"><br></span><span style=3D"background-color: rgb(250, 250, 250); =
color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"background-color:=
 rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">r=
eturn</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb=
(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"background-=
color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-pre=
ttify">[]&lt;</span><span style=3D"background-color: rgb(250, 250, 250); co=
lor: rgb(0, 0, 0);" class=3D"styled-by-prettify">size_t</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">...</span><span style=3D"background-color: rgb(250,=
 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><spa=
n style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 0, 102);" =
class=3D"styled-by-prettify">Indexs</span><span style=3D"background-color: =
rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">=
&gt;(</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb=
(0, 0, 0);" class=3D"styled-by-prettify">std</span><span style=3D"backgroun=
d-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-p=
rettify">::</span><span style=3D"background-color: rgb(250, 250, 250); colo=
r: rgb(0, 0, 0);" class=3D"styled-by-prettify">index_sequence</span><span s=
tyle=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" cla=
ss=3D"styled-by-prettify">&lt;</span><span style=3D"background-color: rgb(2=
50, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prettify">Index=
s</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102=
, 102, 0);" class=3D"styled-by-prettify">...&gt;&amp;&amp;)</span><span sty=
le=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"=
styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"background-colo=
r: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettif=
y">{</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(=
0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0</sp=
an><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 13=
6);" class=3D"styled-by-prettify">return</span><span style=3D"background-co=
lor: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"=
> </span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(10=
2, 0, 102);" class=3D"styled-by-prettify">TemplateCharSeq</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">&lt;</span><span style=3D"background-color: rgb(250=
, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify">str</span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0)=
;" class=3D"styled-by-prettify">[</span><span style=3D"background-color: rg=
b(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prettify">In=
dexs</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(=
102, 102, 0);" class=3D"styled-by-prettify">]...&gt;{};</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"background-color:=
 rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify"=
>}(</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0=
, 0, 0);" class=3D"styled-by-prettify">std</span><span style=3D"background-=
color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-pre=
ttify">::</span><span style=3D"background-color: rgb(250, 250, 250); color:=
 rgb(0, 0, 0);" class=3D"styled-by-prettify">make_index_sequence</span><spa=
n style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 136, 0);" cl=
ass=3D"styled-by-prettify">&lt;len&gt;</span><span style=3D"background-colo=
r: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettif=
y">{});</span><span style=3D"background-color: rgb(250, 250, 250); color: r=
gb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><span style=3D"backgr=
ound-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-b=
y-prettify">}</span><span style=3D"background-color: rgb(250, 250, 250); co=
lor: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br><br></span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"=
styled-by-prettify">//operator[] for std::tuple</span><span style=3D"backgr=
ound-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pr=
ettify"><br></span><span style=3D"background-color: rgb(250, 250, 250); col=
or: rgb(0, 0, 136);" class=3D"styled-by-prettify">template</span><span styl=
e=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"s=
tyled-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, 2=
50); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">&lt;</span><spa=
n style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" cl=
ass=3D"styled-by-prettify">class</span><span style=3D"background-color: rgb=
(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">...=
</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0=
, 0);" class=3D"styled-by-prettify"> </span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prettify=
">Args</span><span style=3D"background-color: rgb(250, 250, 250); color: rg=
b(102, 102, 0);" class=3D"styled-by-prettify">&gt;</span><span style=3D"bac=
kground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by=
-prettify"><br></span><span style=3D"background-color: rgb(250, 250, 250); =
color: rgb(0, 0, 136);" class=3D"styled-by-prettify">struct</span><span sty=
le=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"=
styled-by-prettify"> tuple<br></span><span style=3D"background-color: rgb(2=
50, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{</sp=
an><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0)=
;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"back=
ground-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled=
-by-prettify">...</span><span style=3D"background-color: rgb(250, 250, 250)=
; color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0</spa=
n><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136=
);" class=3D"styled-by-prettify">constexpr</span><span style=3D"background-=
color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-pre=
ttify">(</span><span style=3D"background-color: rgb(250, 250, 250); color: =
rgb(0, 0, 136);" class=3D"styled-by-prettify">true</span><span style=3D"bac=
kground-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"style=
d-by-prettify">)</span><span style=3D"background-color: rgb(250, 250, 250);=
 color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"=
background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styl=
ed-by-prettify">auto</span><span style=3D"background-color: rgb(250, 250, 2=
50); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">&amp;</span><sp=
an style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(250,=
 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">operator</=
span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 1=
02, 0);" class=3D"styled-by-prettify">[](</span><span style=3D"background-c=
olor: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify=
">size_t i</span><span style=3D"background-color: rgb(250, 250, 250); color=
: rgb(102, 102, 0);" class=3D"styled-by-prettify">)</span><span style=3D"ba=
ckground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-b=
y-prettify"> </span><span style=3D"background-color: rgb(250, 250, 250); co=
lor: rgb(0, 0, 136);" class=3D"styled-by-prettify">const</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"background-color: =
rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">=
{</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, =
0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span =
style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" clas=
s=3D"styled-by-prettify">static_assert</span><span style=3D"background-colo=
r: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettif=
y">(</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(=
0, 0, 0);" class=3D"styled-by-prettify">i </span><span style=3D"background-=
color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-pre=
ttify">&lt;</span><span style=3D"background-color: rgb(250, 250, 250); colo=
r: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"backg=
round-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by=
-prettify">sizeof</span><span style=3D"background-color: rgb(250, 250, 250)=
; color: rgb(102, 102, 0);" class=3D"styled-by-prettify">...(</span><span s=
tyle=3D"background-color: rgb(250, 250, 250); color: rgb(102, 0, 102);" cla=
ss=3D"styled-by-prettify">Args</span><span style=3D"background-color: rgb(2=
50, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">));</=
span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, =
0);" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span sty=
le=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=
=3D"styled-by-prettify">return</span><span style=3D"background-color: rgb(2=
50, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> std</spa=
n><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102,=
 0);" class=3D"styled-by-prettify">::</span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">=
get</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0=
, 136, 0);" class=3D"styled-by-prettify">&lt;i&gt;</span><span style=3D"bac=
kground-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"style=
d-by-prettify">(*</span><span style=3D"background-color: rgb(250, 250, 250)=
; color: rgb(0, 0, 136);" class=3D"styled-by-prettify">this</span><span sty=
le=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">);</span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0</span><span style=3D"background-color: rgb(250, 250, 250); color: rg=
b(102, 102, 0);" class=3D"styled-by-prettify">}</span><span style=3D"backgr=
ound-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pr=
ettify"><br><br>=C2=A0 =C2=A0</span><span style=3D"background-color: rgb(25=
0, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">constexp=
r</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102=
, 102, 0);" class=3D"styled-by-prettify">(</span><span style=3D"background-=
color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prett=
ify">true</span><span style=3D"background-color: rgb(250, 250, 250); color:=
 rgb(102, 102, 0);" class=3D"styled-by-prettify">)</span><span style=3D"bac=
kground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by=
-prettify"> </span><span style=3D"background-color: rgb(250, 250, 250); col=
or: rgb(0, 0, 136);" class=3D"styled-by-prettify">auto</span><span style=3D=
"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"s=
tyled-by-prettify">&amp;</span><span style=3D"background-color: rgb(250, 25=
0, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=
=3D"styled-by-prettify">operator</span><span style=3D"background-color: rgb=
(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">[](=
</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0=
, 0);" class=3D"styled-by-prettify">size_t i</span><span style=3D"backgroun=
d-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-p=
rettify">)</span><span style=3D"background-color: rgb(250, 250, 250); color=
: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0</span><span=
 style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" c=
lass=3D"styled-by-prettify">{</span><span style=3D"background-color: rgb(25=
0, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0=
 =C2=A0 =C2=A0 </span><span style=3D"background-color: rgb(250, 250, 250); =
color: rgb(0, 0, 136);" class=3D"styled-by-prettify">static_assert</span><s=
pan style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);=
" class=3D"styled-by-prettify">(</span><span style=3D"background-color: rgb=
(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify">i </spa=
n><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102,=
 0);" class=3D"styled-by-prettify">&lt;</span><span style=3D"background-col=
or: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify">=
 </span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, =
0, 136);" class=3D"styled-by-prettify">sizeof</span><span style=3D"backgrou=
nd-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-=
prettify">...(</span><span style=3D"background-color: rgb(250, 250, 250); c=
olor: rgb(102, 0, 102);" class=3D"styled-by-prettify">Args</span><span styl=
e=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">));</span><span style=3D"background-color: rgb(250,=
 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 </span><span style=3D"background-color: rgb(250, 250, 250); c=
olor: rgb(0, 0, 136);" class=3D"styled-by-prettify">return</span><span styl=
e=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"s=
tyled-by-prettify"> std</span><span style=3D"background-color: rgb(250, 250=
, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">::</span><sp=
an style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" c=
lass=3D"styled-by-prettify">get</span><span style=3D"background-color: rgb(=
250, 250, 250); color: rgb(0, 136, 0);" class=3D"styled-by-prettify">&lt;i&=
gt;</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(1=
02, 102, 0);" class=3D"styled-by-prettify">(*</span><span style=3D"backgrou=
nd-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-pr=
ettify">this</span><span style=3D"background-color: rgb(250, 250, 250); col=
or: rgb(102, 102, 0);" class=3D"styled-by-prettify">);</span><span style=3D=
"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"style=
d-by-prettify"> =C2=A0 =C2=A0 =C2=A0<br>=C2=A0 =C2=A0</span><span style=3D"=
background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"st=
yled-by-prettify">}</span><span style=3D"background-color: rgb(250, 250, 25=
0); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0</s=
pan><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 10=
2, 0);" class=3D"styled-by-prettify">....</span><span style=3D"background-c=
olor: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify=
"><br></span><span style=3D"background-color: rgb(250, 250, 250); color: rg=
b(102, 102, 0);" class=3D"styled-by-prettify">};</span><span style=3D"backg=
round-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-p=
rettify"><br><br></span><span style=3D"background-color: rgb(250, 250, 250)=
; color: rgb(0, 0, 136);" class=3D"styled-by-prettify">template</span><span=
 style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=
=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">&lt;</span=
><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136)=
;" class=3D"styled-by-prettify">class</span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify=
">...</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb=
(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"background-=
color: rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-pre=
ttify">Args</span><span style=3D"background-color: rgb(250, 250, 250); colo=
r: rgb(102, 102, 0);" class=3D"styled-by-prettify">&gt;</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, 25=
0); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">struct</span><span=
 style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=
=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prettify">Select</sp=
an><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0)=
;" class=3D"styled-by-prettify"> </span><span style=3D"background-color: rg=
b(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">:<=
/span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0,=
 0);" class=3D"styled-by-prettify"> </span><span style=3D"background-color:=
 rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prettify"=
>Args</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb=
(102, 102, 0);" class=3D"styled-by-prettify">...</span><span style=3D"backg=
round-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-p=
rettify"> </span><span style=3D"background-color: rgb(250, 250, 250); color=
: rgb(102, 102, 0);" class=3D"styled-by-prettify">{</span><span style=3D"ba=
ckground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-b=
y-prettify"> </span><span style=3D"background-color: rgb(250, 250, 250); co=
lor: rgb(0, 0, 136);" class=3D"styled-by-prettify">using</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, 25=
0); color: rgb(102, 0, 102);" class=3D"styled-by-prettify">Args</span><span=
 style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" c=
lass=3D"styled-by-prettify">::</span><span style=3D"background-color: rgb(2=
50, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">operato=
r</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102=
, 102, 0);" class=3D"styled-by-prettify">()...;</span><span style=3D"backgr=
ound-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pr=
ettify"> </span><span style=3D"background-color: rgb(250, 250, 250); color:=
 rgb(102, 102, 0);" class=3D"styled-by-prettify">};</span><span style=3D"ba=
ckground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-b=
y-prettify"><br></span><span style=3D"background-color: rgb(250, 250, 250);=
 color: rgb(0, 0, 136);" class=3D"styled-by-prettify">template</span><span =
style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=
=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">&lt;</span=
><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136)=
;" class=3D"styled-by-prettify">class</span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify=
">...</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb=
(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"background-=
color: rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-pre=
ttify">Args</span><span style=3D"background-color: rgb(250, 250, 250); colo=
r: rgb(102, 102, 0);" class=3D"styled-by-prettify">&gt;</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, 25=
0); color: rgb(102, 0, 102);" class=3D"styled-by-prettify">Select</span><sp=
an style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);"=
 class=3D"styled-by-prettify">(</span><span style=3D"background-color: rgb(=
250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prettify">Args=
</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102,=
 102, 0);" class=3D"styled-by-prettify">&amp;&amp;...)</span><span style=3D=
"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"style=
d-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, 250);=
 color: rgb(102, 102, 0);" class=3D"styled-by-prettify">-&gt;</span><span s=
tyle=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=
=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prettify">Select</sp=
an><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102=
, 0);" class=3D"styled-by-prettify">&lt;</span><span style=3D"background-co=
lor: rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-by-prett=
ify">Args</span><span style=3D"background-color: rgb(250, 250, 250); color:=
 rgb(102, 102, 0);" class=3D"styled-by-prettify">...&gt;;</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"><br><br></span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//for lambd=
as</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0,=
 0, 0);" class=3D"styled-by-prettify"><br></span><span style=3D"background-=
color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prett=
ify">void</span><span style=3D"background-color: rgb(250, 250, 250); color:=
 rgb(0, 0, 0);" class=3D"styled-by-prettify"> func_3</span><span style=3D"b=
ackground-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"sty=
led-by-prettify">()</span><span style=3D"background-color: rgb(250, 250, 25=
0); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><span sty=
le=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify">{</span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 </s=
pan><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 1=
36);" class=3D"styled-by-prettify">constexpr</span><span style=3D"backgroun=
d-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prett=
ify"> </span><span style=3D"background-color: rgb(250, 250, 250); color: rg=
b(0, 0, 136);" class=3D"styled-by-prettify">auto</span><span style=3D"backg=
round-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-p=
rettify"> f_0 </span><span style=3D"background-color: rgb(250, 250, 250); c=
olor: rgb(102, 102, 0);" class=3D"styled-by-prettify">=3D</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"> </span><span style=3D"background-color: rgb(250, 250, 25=
0); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">[]()</span><span=
 style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=
=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(250, 2=
50, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{};</span>=
<span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" =
class=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(2=
50, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//opera=
tor() is constexpr /*fallback on runtime*/, no changes</span><span style=3D=
"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"style=
d-by-prettify"><br>=C2=A0 </span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">constexpr</=
span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, =
0);" class=3D"styled-by-prettify"> </span><span style=3D"background-color: =
rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">au=
to</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0,=
 0, 0);" class=3D"styled-by-prettify"> f_1 </span><span style=3D"background=
-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-pr=
ettify">=3D</span><span style=3D"background-color: rgb(250, 250, 250); colo=
r: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"backg=
round-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-=
by-prettify">[]()</span><span style=3D"background-color: rgb(250, 250, 250)=
; color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D=
"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"sty=
led-by-prettify">constexpr</span><span style=3D"background-color: rgb(250, =
250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">(</span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);"=
 class=3D"styled-by-prettify">false</span><span style=3D"background-color: =
rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">=
)</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, =
0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"background-colo=
r: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettif=
y">{};</span><span style=3D"background-color: rgb(250, 250, 250); color: rg=
b(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"background=
-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-by-pret=
tify">//operator() cannot be called at compile-time</span><span style=3D"ba=
ckground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-b=
y-prettify"><br>=C2=A0 </span><span style=3D"background-color: rgb(250, 250=
, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">constexpr</spa=
n><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);=
" class=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb=
(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">auto<=
/span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0,=
 0);" class=3D"styled-by-prettify"> f_2 </span><span style=3D"background-co=
lor: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prett=
ify">=3D</span><span style=3D"background-color: rgb(250, 250, 250); color: =
rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"backgrou=
nd-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-=
prettify">[]()</span><span style=3D"background-color: rgb(250, 250, 250); c=
olor: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"ba=
ckground-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled=
-by-prettify">constexpr</span><span style=3D"background-color: rgb(250, 250=
, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">(</span><spa=
n style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);" cl=
ass=3D"styled-by-prettify">true</span><span style=3D"background-color: rgb(=
250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">)</s=
pan><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0=
);" class=3D"styled-by-prettify"> </span><span style=3D"background-color: r=
gb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{=
};</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0,=
 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"background-col=
or: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"styled-by-prettify=
">//operator() can only be called a compile-time and explicitly</span><span=
 style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=
=3D"styled-by-prettify"><br><br>=C2=A0 </span><span style=3D"background-col=
or: rgb(250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify=
">constexpr</span><span style=3D"background-color: rgb(250, 250, 250); colo=
r: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"backg=
round-color: rgb(250, 250, 250); color: rgb(102, 0, 102);" class=3D"styled-=
by-prettify">Select</span><span style=3D"background-color: rgb(250, 250, 25=
0); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> f_3 </span><span st=
yle=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" clas=
s=3D"styled-by-prettify">=3D</span><span style=3D"background-color: rgb(250=
, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><sp=
an style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102, 0);"=
 class=3D"styled-by-prettify">{</span><span style=3D"background-color: rgb(=
250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> f_1</sp=
an><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102, 102=
, 0);" class=3D"styled-by-prettify">,</span><span style=3D"background-color=
: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> f=
_2 </span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(1=
02, 102, 0);" class=3D"styled-by-prettify">};</span><span style=3D"backgrou=
nd-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pret=
tify"> <br><br>=C2=A0 </span><span style=3D"background-color: rgb(250, 250,=
 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">constexpr</span=
><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);"=
 class=3D"styled-by-prettify"> </span><span style=3D"background-color: rgb(=
250, 250, 250); color: rgb(0, 0, 136);" class=3D"styled-by-prettify">auto</=
span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, =
0);" class=3D"styled-by-prettify"> r_4 </span><span style=3D"background-col=
or: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-by-pretti=
fy">=3D</span><span style=3D"background-color: rgb(250, 250, 250); color: r=
gb(0, 0, 0);" class=3D"styled-by-prettify"> f_3</span><span style=3D"backgr=
ound-color: rgb(250, 250, 250); color: rgb(102, 102, 0);" class=3D"styled-b=
y-prettify">();</span><span style=3D"background-color: rgb(250, 250, 250); =
color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"b=
ackground-color: rgb(250, 250, 250); color: rgb(136, 0, 0);" class=3D"style=
d-by-prettify">//f_2</span><span style=3D"background-color: rgb(250, 250, 2=
50); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>=C2=A0 </span><=
span style=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 136);"=
 class=3D"styled-by-prettify">auto</span><span style=3D"background-color: r=
gb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> r_5 =
</span><span style=3D"background-color: rgb(250, 250, 250); color: rgb(102,=
 102, 0);" class=3D"styled-by-prettify">=3D</span><span style=3D"background=
-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-by-pretti=
fy"> f_3</span><span style=3D"background-color: rgb(250, 250, 250); color: =
rgb(102, 102, 0);" class=3D"styled-by-prettify">();</span><span style=3D"ba=
ckground-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"styled-b=
y-prettify"> </span><span style=3D"background-color: rgb(250, 250, 250); co=
lor: rgb(136, 0, 0);" class=3D"styled-by-prettify">//f_1</span><span style=
=3D"background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"><br></span></code><span style=3D"" class=3D"styled-by-pre=
ttify"><code class=3D"prettyprint"><font color=3D"#666600"><span style=3D"b=
ackground-color: rgb(250, 250, 250);">}</span></font></code></span></div></=
div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex=
;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><div=
><br></div><div>Here is the summary:</div><div><br></div><div>- extend cons=
texpr specifier to allow it to take a constexpr explicit bool (no a constex=
pr expression unless if there are good use-cases for it) where:</div><div><=
ul><li>constexpr(false) is the default specifier of a function/method</li><=
ul><li>optional for functions/method.</li><li>if specified with lambdas all=
ows not-constexpr lambda as lambdas are by default constexpr.</li></ul><li>=
constexpr(true) is a constexpr only function.</li><ul><li>no Assembly repre=
sentation (no linkage nor mangling).</li><li>all arguments are constexpr.</=
li><li>error if non-constexpr expression is used (a constexpr fallback to r=
untime because of an overflow for instance).</li><li>only used in explicit =
constexpr context.</li><li>cannot be called before its specialization if sp=
ecialization or else error.<br></li></ul><li>constexpr</li><ul><li>keeps al=
l its properties and definition.</li><li>will still trigger redefinition er=
ror if previous constexpr(false) version previously defined.</li><li>conste=
xpr attribute ignored if previous constexpr(true) is defined.</li></ul></ul=
></div><div>- unary constexpr operator to request a constexpr expression ex=
plicitly:</div><div><div style=3D"background-color:rgb(250,250,250);border-=
color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-=
word"><code><div><span style=3D"color:#000">=C2=A0 =C2=A0</span><span style=
=3D"color:#008">auto</span><span style=3D"color:#000"> t </span><span style=
=3D"color:#660">=3D</span><span style=3D"color:#000"> </span><span style=3D=
"color:#008">constexpr</span><span style=3D"color:#000"> expr</span><span s=
tyle=3D"color:#660">;</span><span style=3D"color:#000"> </span><span style=
=3D"color:#800">//might error if expr is no a constexpr expression</span></=
div></code></div><br>The reason why I believe in this proposal:</div><div><=
ul><li>no new keyword.</li><li>zero runtime impact.</li><li>maintains backw=
ard compatibility.</li><li>solves, at least partially, a lot of different p=
roposals.</li></ul><div>Thanks in advance,</div><div><br></div><div>Bastien=
 Penavayre,</div></div></div><div><a href=3D"mailto:bastienPenava@gmail.com=
" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;mailto=
:bastienPenava@gmail.com&#39;;return true;" onclick=3D"this.href=3D&#39;mai=
lto:bastienPenava@gmail.com&#39;;return true;">bastienPenava@gmail.com</a><=
/div></div></blockquote></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/7978cd34-ff03-4903-88d6-00c3fbd68119%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7978cd34-ff03-4903-88d6-00c3fbd68119=
%40isocpp.org</a>.<br />

------=_Part_904_1162844812.1505467865074--

------=_Part_903_1526549714.1505467865071--

.