Topic: overload function


Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Sat, 24 Jan 2015 10:36:21 +0100
Raw View
This is a multi-part message in MIME format.
--------------070603090601000802020601
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi,

I have written a draft proposal for an overload function [1].

Any comments or contributions are welcome.

BTW, is the .md a valid format for a proposal? are there some .md to
html/pdf converters?

Vicente

[1]
https://github.com/viboes/tags/blob/master/doc/proposals/overload/DXXXX_Overload.md

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--------------070603090601000802020601
Content-Type: text/html; charset=UTF-8

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font size="+1">Hi,<br>
      <br>
      I have written a draft proposal for an overload function </font><font
      size="+1">[1].<br>
      <br>
      Any comments or contributions are welcome.<br>
      <br>
      BTW, is the .md a valid format for a proposal? are there some .md
      to html/pdf converters?<br>
      <br>
    </font><font size="+1">Vicente<br>
    </font><br>
    [1]
<a class="moz-txt-link-freetext" href="https://github.com/viboes/tags/blob/master/doc/proposals/overload/DXXXX_Overload.md">https://github.com/viboes/tags/blob/master/doc/proposals/overload/DXXXX_Overload.md</a><br>
  </body>
</html>

<p></p>

-- <br />
<br />
--- <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 email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />

--------------070603090601000802020601--

.


Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Sat, 24 Jan 2015 10:03:19 +0000
Raw View
What is .md?

Acceptable formats: .txt, .pdf, .htm(l) and .rtf.

On 1/24/15, Vicente J. Botet Escriba <vicente.botet@wanadoo.fr> wrote:
> Hi,
>
> I have written a draft proposal for an overload function [1].
>
> Any comments or contributions are welcome.
>
> BTW, is the .md a valid format for a proposal? are there some .md to
> html/pdf converters?
>
> Vicente
>
> [1]
> https://github.com/viboes/tags/blob/master/doc/proposals/overload/DXXXX_Overload.md
>
> --
>
> ---
> 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.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Sat, 24 Jan 2015 11:51:16 +0100
Raw View
Le 24/01/15 11:03, Douglas Boffey a =C3=A9crit :
> What is .md?
GitHub MarkDown format https://help.github.com/articles/markdown-basics/
> Acceptable formats: .txt, .pdf, .htm(l) and .rtf.
>
..md files a text only, would this be acceptable.
> [1]
> https://github.com/viboes/tags/blob/master/doc/proposals/overload/DXXXX_O=
verload.md
>
>

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: Scott Prager <splinterofchaos@gmail.com>
Date: Sat, 24 Jan 2015 17:30:01 -0800 (PST)
Raw View
------=_Part_8_533992173.1422149401829
Content-Type: multipart/alternative;
 boundary="----=_Part_9_472290798.1422149401829"

------=_Part_9_472290798.1422149401829
Content-Type: text/plain; charset=UTF-8



On Saturday, January 24, 2015 at 4:36:23 AM UTC-5, Vicente J. Botet Escriba
wrote:
>
>  Hi,
>
> I have written a draft proposal for an overload function [1].
>
> Any comments or contributions are welcome.
>
> BTW, is the .md a valid format for a proposal? are there some .md to
> html/pdf converters?
>
> Vicente
>
> [1]
> https://github.com/viboes/tags/blob/master/doc/proposals/overload/DXXXX_Overload.md
>

Good luck with this. BTW, I recently read about overloading functions by
using a Rank<N> type where N >= 0.

template<size_t N>
struct Rank : Rank<N-1> {
};


template<>
struct Rank<0> {
};


int f(Rank<1>, int);
int g(Rank<0>, int);


auto o = overload(f,g);
int x = o(Rank<1>{}, 0);  // calls f


(Earliest source I could find:
http://flamingdangerzone.com/cxx11/2013/03/11/overload-ranking.html )

Without the `Rank<N>` parameters, `x = o(0)` would be ambiguous. A ranked
overload might also be useful for disambiguating overloads, especially when
f or g is a transparent function object, like "std::less<>". I have a
working version here
<https://github.com/splinterofchaos/fu/blob/c8db291d60263b131cb0fce645874b4ce3e26baa/include/fu/functional.h#L109-L140>
 that implicitly adds the rank parameter.

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_9_472290798.1422149401829
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Saturday, January 24, 2015 at 4:36:23 AM UTC-5,=
 Vicente J. Botet Escriba wrote:<blockquote class=3D"gmail_quote" style=3D"=
margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;=
">
 =20

   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <font size=3D"+1">Hi,<br>
      <br>
      I have written a draft proposal for an overload function </font><font=
 size=3D"+1">[1].<br>
      <br>
      Any comments or contributions are welcome.<br>
      <br>
      BTW, is the .md a valid format for a proposal? are there some .md
      to html/pdf converters?<br>
      <br>
    </font><font size=3D"+1">Vicente<br>
    </font><br>
    [1]
<a href=3D"https://github.com/viboes/tags/blob/master/doc/proposals/overloa=
d/DXXXX_Overload.md" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this=
..href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fviboes%2=
Ftags%2Fblob%2Fmaster%2Fdoc%2Fproposals%2Foverload%2FDXXXX_Overload.md\46sa=
\75D\46sntz\0751\46usg\75AFQjCNGpK6BJyZwWooQMN9Hpi6UPbDMFAg';return true;" =
onclick=3D"this.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub=
..com%2Fviboes%2Ftags%2Fblob%2Fmaster%2Fdoc%2Fproposals%2Foverload%2FDXXXX_O=
verload.md\46sa\75D\46sntz\0751\46usg\75AFQjCNGpK6BJyZwWooQMN9Hpi6UPbDMFAg'=
;return true;">https://github.com/viboes/<wbr>tags/blob/master/doc/<wbr>pro=
posals/overload/DXXXX_<wbr>Overload.md</a></div></blockquote><div><br></div=
><div>Good luck with this. BTW, I recently read about overloading functions=
 by using a Rank&lt;N&gt; type where N &gt;=3D 0.</div><div><br></div><div =
class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-w=
rap: break-word; background-color: rgb(250, 250, 250);"><code class=3D"pret=
typrint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">template</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">size_t N</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">struct</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Rank</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #60=
6;" class=3D"styled-by-prettify">Rank</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">N</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">-</span><span style=3D"color: #066;" class=3D"styled-by-prettif=
y">1</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">};</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br><br><br></span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">template</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&lt;&gt;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-b=
y-prettify">Rank</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">&lt;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">=
0</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">};</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br><br><br></span><span style=3D"color: #008;"=
 class=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> f</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">(</span><span style=3D"color: #606;" class=3D"styled-by-pre=
ttify">Rank</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>&lt;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">1</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;,</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> g</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">(</span><span style=3D"color: #606;" class=3D"styled-by-prettify=
">Rank</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;=
</span><span style=3D"color: #066;" class=3D"styled-by-prettify">0</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&gt;,</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br><br><br></span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> o </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> overload</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
f</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">g</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">int</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> x </span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> o</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">(</span><span style=3D"color: #606;" class=3D"styled-by-prettify">Rank=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span=
><span style=3D"color: #066;" class=3D"styled-by-prettify">1</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">&gt;{},</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #066;" class=3D"styled-by-prettify">0</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> &nbsp;</span><span style=3D"color: #800;" class=3D"st=
yled-by-prettify">// calls f</span></div></code></div><div><br></div><div><=
br></div><div>(Earliest source I could find: http://flamingdangerzone.com/c=
xx11/2013/03/11/overload-ranking.html )</div><div><span style=3D"font-size:=
 13px;"><br></span></div><div><span style=3D"font-size: 13px;">Without the =
`Rank&lt;N&gt;` parameters, `x =3D o(0)` would be ambiguous. A ranked overl=
oad might also be useful for disambiguating overloads, especially when f or=
 g is a transparent function object, like "std::less&lt;&gt;". I have a wor=
king version </span><a href=3D"https://github.com/splinterofchaos/fu/blob/c=
8db291d60263b131cb0fce645874b4ce3e26baa/include/fu/functional.h#L109-L140" =
style=3D"font-size: 13px;">here</a><span style=3D"font-size: 13px;">&nbsp;t=
hat&nbsp;</span>implicitly<span style=3D"font-size: 13px;">&nbsp;adds the r=
ank parameter.</span></div></div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_9_472290798.1422149401829--
------=_Part_8_533992173.1422149401829--

.


Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Sun, 25 Jan 2015 12:09:47 +0100
Raw View
This is a multi-part message in MIME format.
--------------060203050506020504010704
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Le 25/01/15 02:30, Scott Prager a =C3=A9crit :
>
>
> On Saturday, January 24, 2015 at 4:36:23 AM UTC-5, Vicente J. Botet=20
> Escriba wrote:
>
>     Hi,
>
>     I have written a draft proposal for an overload function [1].
>
>     Any comments or contributions are welcome.
>
>     BTW, is the .md a valid format for a proposal? are there some .md
>     to html/pdf converters?
>
>     Vicente
>
>     [1]
>     https://github.com/viboes/tags/blob/master/doc/proposals/overload/DXX=
XX_Overload.md
>     <https://github.com/viboes/tags/blob/master/doc/proposals/overload/DX=
XXX_Overload.md>
>
>
> Good luck with this. BTW, I recently read about overloading functions=20
> by using a Rank<N> type where N >=3D 0.
>
> |
> template<size_t N>
> structRank:Rank<N-1>{
> };
>
>
> template<>
> structRank<0>{
> };
>
>
> intf(Rank<1>,int);
> intg(Rank<0>,int);
>
>
> autoo =3Doverload(f,g);
> intx =3Do(Rank<1>{},0);// calls f
> |
>
>
> (Earliest source I could find:=20
> http://flamingdangerzone.com/cxx11/2013/03/11/overload-ranking.html )
>
> Without the `Rank<N>` parameters, `x =3D o(0)` would be ambiguous. A=20
> ranked overload might also be useful for disambiguating overloads,=20
> especially when f or g is a transparent function object, like=20
> "std::less<>". I have a working version here=20
> <https://github.com/splinterofchaos/fu/blob/c8db291d60263b131cb0fce645874=
b4ce3e26baa/include/fu/functional.h#L109-L140> that=20
> implicitly adds the rank parameter.
>
Hi,

IIUC you are proposing an additional ranked_overload function that=20
accepts optionally the rank, an defaults it to the first one, isn't it?


Vicente

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

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

<html>
  <head>
    <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div class=3D"moz-cite-prefix">Le 25/01/15 02:30, Scott Prager a
      =C3=A9crit=C2=A0:<br>
    </div>
    <blockquote
      cite=3D"mid:1f5e8225-b1f7-4ebb-b87e-13e282d6c770@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr"><br>
        <br>
        On Saturday, January 24, 2015 at 4:36:23 AM UTC-5, Vicente J.
        Botet Escriba wrote:
        <blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:
          0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
          <div bgcolor=3D"#FFFFFF" text=3D"#000000"> <font size=3D"+1">Hi,<=
br>
              <br>
              I have written a draft proposal for an overload function </fo=
nt><font
              size=3D"+1">[1].<br>
              <br>
              Any comments or contributions are welcome.<br>
              <br>
              BTW, is the .md a valid format for a proposal? are there
              some .md to html/pdf converters?<br>
              <br>
            </font><font size=3D"+1">Vicente<br>
            </font><br>
            [1]
            <a moz-do-not-send=3D"true"
href=3D"https://github.com/viboes/tags/blob/master/doc/proposals/overload/D=
XXXX_Overload.md"
              target=3D"_blank" rel=3D"nofollow"
              onmousedown=3D"this.href=3D'https://www.google.com/url?q\75ht=
tps%3A%2F%2Fgithub.com%2Fviboes%2Ftags%2Fblob%2Fmaster%2Fdoc%2Fproposals%2F=
overload%2FDXXXX_Overload.md\46sa\75D\46sntz\0751\46usg\75AFQjCNGpK6BJyZwWo=
oQMN9Hpi6UPbDMFAg';return
              true;"
              onclick=3D"this.href=3D'https://www.google.com/url?q\75https%=
3A%2F%2Fgithub.com%2Fviboes%2Ftags%2Fblob%2Fmaster%2Fdoc%2Fproposals%2Fover=
load%2FDXXXX_Overload.md\46sa\75D\46sntz\0751\46usg\75AFQjCNGpK6BJyZwWooQMN=
9Hpi6UPbDMFAg';return
              true;">https://github.com/viboes/<wbr>tags/blob/master/doc/<w=
br>proposals/overload/DXXXX_<wbr>Overload.md</a></div>
        </blockquote>
        <div><br>
        </div>
        <div>Good luck with this. BTW, I recently read about overloading
          functions by using a Rank&lt;N&gt; type where N &gt;=3D 0.</div>
        <div><br>
        </div>
        <div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187,
          187); word-wrap: break-word; background-color: rgb(250, 250,
          250);"><code class=3D"prettyprint">
            <div class=3D"subprettyprint"><span style=3D"color: #008;"
                class=3D"styled-by-prettify">template</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify">size_t =
N</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">struct</span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #606;" class=3D"styled-by-prettify">Rank</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </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: #606;" class=3D"styled-by-prettify">Rank</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify">N</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">-</span=
><span
                style=3D"color: #066;" class=3D"styled-by-prettify">1</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">{</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              </span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">};</span><span style=3D"color:
                #000;" class=3D"styled-by-prettify"><br>
                <br>
                <br>
              </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">template</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&gt=
;</span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">struct</span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #606;" class=3D"styled-by-prettify">Rank</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">0</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">{</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              </span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">};</span><span style=3D"color:
                #000;" class=3D"styled-by-prettify"><br>
                <br>
                <br>
              </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">int</span><span style=3D"color=
:
                #000;" class=3D"styled-by-prettify"> f</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #606;" class=3D"styled-by-prettify">Rank</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">1</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;,</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">int</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">);</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">int</span><span style=3D"color=
:
                #000;" class=3D"styled-by-prettify"> g</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #606;" class=3D"styled-by-prettify">Rank</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">0</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;,</=
span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #008;" class=3D"styled-by-prettify">int</sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">);</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
                <br>
                <br>
              </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">auto</span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> o </sp=
an><span
                style=3D"color: #660;" class=3D"styled-by-prettify">=3D</sp=
an><span
                style=3D"color: #000;" class=3D"styled-by-prettify">
                overload</span><span style=3D"color: #660;"
                class=3D"styled-by-prettify">(</span><span style=3D"color:
                #000;" class=3D"styled-by-prettify">f</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span
                style=3D"color: #000;" class=3D"styled-by-prettify">g</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">);</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              </span><span style=3D"color: #008;"
                class=3D"styled-by-prettify">int</span><span style=3D"color=
:
                #000;" class=3D"styled-by-prettify"> x </span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">=3D</sp=
an><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> o</spa=
n><span
                style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
                style=3D"color: #606;" class=3D"styled-by-prettify">Rank</s=
pan><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span
                style=3D"color: #066;" class=3D"styled-by-prettify">1</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">&gt;{},=
</span><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
                style=3D"color: #066;" class=3D"styled-by-prettify">0</span=
><span
                style=3D"color: #660;" class=3D"styled-by-prettify">);</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify"> =C2=A0=
</span><span
                style=3D"color: #800;" class=3D"styled-by-prettify">// call=
s
                f</span></div>
          </code></div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>(Earliest source I could find:
          <a class=3D"moz-txt-link-freetext" href=3D"http://flamingdangerzo=
ne.com/cxx11/2013/03/11/overload-ranking.html">http://flamingdangerzone.com=
/cxx11/2013/03/11/overload-ranking.html</a>
          )</div>
        <div><span style=3D"font-size: 13px;"><br>
          </span></div>
        <div><span style=3D"font-size: 13px;">Without the `Rank&lt;N&gt;`
            parameters, `x =3D o(0)` would be ambiguous. A ranked overload
            might also be useful for disambiguating overloads,
            especially when f or g is a transparent function object,
            like "std::less&lt;&gt;". I have a working version </span><a
            moz-do-not-send=3D"true"
href=3D"https://github.com/splinterofchaos/fu/blob/c8db291d60263b131cb0fce6=
45874b4ce3e26baa/include/fu/functional.h#L109-L140"
            style=3D"font-size: 13px;">here</a><span style=3D"font-size:
            13px;">=C2=A0that=C2=A0</span>implicitly<span style=3D"font-siz=
e: 13px;">=C2=A0adds
            the rank parameter.</span></div>
      </div>
      <br>
    </blockquote>
    Hi,<br>
    <br>
    IIUC you are proposing an additional ranked_overload function that
    accepts optionally the rank, an defaults it to the first one, isn't
    it?<br>
    <br>
    <br>
    Vicente<br>
  </body>
</html>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--------------060203050506020504010704--

.


Author: Scott Prager <splinterofchaos@gmail.com>
Date: Sun, 25 Jan 2015 11:15:17 -0800 (PST)
Raw View
------=_Part_256_233252854.1422213317709
Content-Type: multipart/alternative;
 boundary="----=_Part_257_1123061403.1422213317709"

------=_Part_257_1123061403.1422213317709
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Sunday, January 25, 2015 at 6:09:50 AM UTC-5, Vicente J. Botet Escriba=
=20
wrote:
>
>  Le 25/01/15 02:30, Scott Prager a =C3=A9crit :
> =20
>
>
> On Saturday, January 24, 2015 at 4:36:23 AM UTC-5, Vicente J. Botet=20
> Escriba wrote:=20
>>
>>  Hi,
>>
>> I have written a draft proposal for an overload function [1].
>>
>> Any comments or contributions are welcome.
>>
>> BTW, is the .md a valid format for a proposal? are there some .md to=20
>> html/pdf converters?
>>
>> Vicente
>>
>> [1]=20
>> https://github.com/viboes/tags/blob/master/doc/proposals/overload/DXXXX_=
Overload.md
>>
>
>  Good luck with this. BTW, I recently read about overloading functions by=
=20
> using a Rank<N> type where N >=3D 0.
>
>  template<size_t N>
> struct Rank : Rank<N-1> {
> };
>
>
> template<>
> struct Rank<0> {
> };
>
>
> int f(Rank<1>, int);
> int g(Rank<0>, int);
>
>
> auto o =3D overload(f,g);
> int x =3D o(Rank<1>{}, 0);  // calls f
> =20
> =20
>  (Earliest source I could find:=20
> http://flamingdangerzone.com/cxx11/2013/03/11/overload-ranking.html )
>
>  Without the `Rank<N>` parameters, `x =3D o(0)` would be ambiguous. A=20
> ranked overload might also be useful for disambiguating overloads,=20
> especially when f or g is a transparent function object, like=20
> "std::less<>". I have a working version here=20
> <https://github.com/splinterofchaos/fu/blob/c8db291d60263b131cb0fce645874=
b4ce3e26baa/include/fu/functional.h#L109-L140>
>  that implicitly adds the rank parameter.
> =20
>  Hi,
>
> IIUC you are proposing an additional ranked_overload function that accept=
s=20
> optionally the rank, an defaults it to the first one, isn't it
>

Sort of, but it needn't accept an optional rank, only Rank<1> and Rank<0>=
=20
are needed because "ranked_overload" can be defined recursively.

auto o =3D ranked_overload([](int, int) { ... },
                         [](float, auto) { ... },
                         [](auto, auto) { ... });
// decltype(o) =3D RankedOverload<F, RankedOverload<G,H>>

So, "o(x,y)" invokes "o.call(Rank<1>(), x, y)" and if SFINAE forbids=20
"[](int, int)", then it calls

ranked_overload([](float, auto) { ... },
                [](auto, auto) { ... })(x,y);

I suppose a version where each function would have a unique rank and an=20
"operator()" overload that could accept a "Rank<N>" in order to specify=20
which function to call would be possible, but I don't see a use for that=20
and it'd be a little bit harder to write. (I tried that before I settled on=
=20
just using "Rank<1>" and "<0>".)

One gotcha that I've found about explicit overloading like this is that if=
=20
you pass in a function with the signature "[](auto&& x, auto&& y)=20
{f(x,y);}" and while there may be a function on the set considered a near=
=20
match to "x" and "y", and "f" might require a conversion of both, the=20
signature binds to anything, thus hiding the conversions in the body so=20
they don't participate in overload resolution making it appear as an exact=
=20
match. That might surprise a few people. It's one example of when one might=
=20
prefer a "ranked_overload".
=20

>
> Vicente
> =20

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_257_1123061403.1422213317709
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Sunday, January 25, 2015 at 6:09:50 AM UTC-5, V=
icente J. Botet Escriba wrote:<blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div>Le 25/01/15 02:30, Scott Prager a
      =C3=A9crit&nbsp;:<br>
    </div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr"><br>
        <br>
        On Saturday, January 24, 2015 at 4:36:23 AM UTC-5, Vicente J.
        Botet Escriba wrote:
        <blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8=
ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor=3D"#FFFFFF" text=3D"#000000"> <font size=3D"+1">Hi,<=
br>
              <br>
              I have written a draft proposal for an overload function </fo=
nt><font size=3D"+1">[1].<br>
              <br>
              Any comments or contributions are welcome.<br>
              <br>
              BTW, is the .md a valid format for a proposal? are there
              some .md to html/pdf converters?<br>
              <br>
            </font><font size=3D"+1">Vicente<br>
            </font><br>
            [1]
            <a href=3D"https://github.com/viboes/tags/blob/master/doc/propo=
sals/overload/DXXXX_Overload.md" rel=3D"nofollow" target=3D"_blank" onmouse=
down=3D"this.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub.co=
m%2Fviboes%2Ftags%2Fblob%2Fmaster%2Fdoc%2Fproposals%2Foverload%2FDXXXX_Over=
load.md\46sa\75D\46sntz\0751\46usg\75AFQjCNGpK6BJyZwWooQMN9Hpi6UPbDMFAg';re=
turn true;" onclick=3D"this.href=3D'https://www.google.com/url?q\75https%3A=
%2F%2Fgithub.com%2Fviboes%2Ftags%2Fblob%2Fmaster%2Fdoc%2Fproposals%2Foverlo=
ad%2FDXXXX_Overload.md\46sa\75D\46sntz\0751\46usg\75AFQjCNGpK6BJyZwWooQMN9H=
pi6UPbDMFAg';return true;">https://github.com/viboes/<wbr>tags/blob/master/=
doc/<wbr>proposals/overload/DXXXX_<wbr>Overload.md</a></div>
        </blockquote>
        <div><br>
        </div>
        <div>Good luck with this. BTW, I recently read about overloading
          functions by using a Rank&lt;N&gt; type where N &gt;=3D 0.</div>
        <div><br>
        </div>
        <div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-wor=
d;background-color:rgb(250,250,250)"><code>
            <div><span style=3D"color:#008">template</span><span style=3D"c=
olor:#660">&lt;</span><span style=3D"color:#000">size_t N</span><span style=
=3D"color:#660">&gt;</span><span style=3D"color:#000"><br>
              </span><span style=3D"color:#008">struct</span><span style=3D=
"color:#000"> </span><span style=3D"color:#606">Rank</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#660">:</span><span style=3D"color:=
#000"> </span><span style=3D"color:#606">Rank</span><span style=3D"color:#6=
60">&lt;</span><span style=3D"color:#000">N</span><span style=3D"color:#660=
">-</span><span style=3D"color:#066">1</span><span style=3D"color:#660">&gt=
;</span><span style=3D"color:#000"> </span><span style=3D"color:#660">{</sp=
an><span style=3D"color:#000"><br>
              </span><span style=3D"color:#660">};</span><span style=3D"col=
or:#000"><br>
                <br>
                <br>
              </span><span style=3D"color:#008">template</span><span style=
=3D"color:#660">&lt;&gt;</span><span style=3D"color:#000"><br>
              </span><span style=3D"color:#008">struct</span><span style=3D=
"color:#000"> </span><span style=3D"color:#606">Rank</span><span style=3D"c=
olor:#660">&lt;</span><span style=3D"color:#066">0</span><span style=3D"col=
or:#660">&gt;</span><span style=3D"color:#000"> </span><span style=3D"color=
:#660">{</span><span style=3D"color:#000"><br>
              </span><span style=3D"color:#660">};</span><span style=3D"col=
or:#000"><br>
                <br>
                <br>
              </span><span style=3D"color:#008">int</span><span style=3D"co=
lor:#000"> f</span><span style=3D"color:#660">(</span><span style=3D"color:=
#606">Rank</span><span style=3D"color:#660">&lt;</span><span style=3D"color=
:#066">1</span><span style=3D"color:#660">&gt;,</span><span style=3D"color:=
#000"> </span><span style=3D"color:#008">int</span><span style=3D"color:#66=
0">);</span><span style=3D"color:#000"><br>
              </span><span style=3D"color:#008">int</span><span style=3D"co=
lor:#000"> g</span><span style=3D"color:#660">(</span><span style=3D"color:=
#606">Rank</span><span style=3D"color:#660">&lt;</span><span style=3D"color=
:#066">0</span><span style=3D"color:#660">&gt;,</span><span style=3D"color:=
#000"> </span><span style=3D"color:#008">int</span><span style=3D"color:#66=
0">);</span><span style=3D"color:#000"><br>
                <br>
                <br>
              </span><span style=3D"color:#008">auto</span><span style=3D"c=
olor:#000"> o </span><span style=3D"color:#660">=3D</span><span style=3D"co=
lor:#000">
                overload</span><span style=3D"color:#660">(</span><span sty=
le=3D"color:#000">f</span><span style=3D"color:#660">,</span><span style=3D=
"color:#000">g</span><span style=3D"color:#660">);</span><span style=3D"col=
or:#000"><br>
              </span><span style=3D"color:#008">int</span><span style=3D"co=
lor:#000"> x </span><span style=3D"color:#660">=3D</span><span style=3D"col=
or:#000"> o</span><span style=3D"color:#660">(</span><span style=3D"color:#=
606">Rank</span><span style=3D"color:#660">&lt;</span><span style=3D"color:=
#066">1</span><span style=3D"color:#660">&gt;{},</span><span style=3D"color=
:#000"> </span><span style=3D"color:#066">0</span><span style=3D"color:#660=
">);</span><span style=3D"color:#000"> &nbsp;</span><span style=3D"color:#8=
00">// calls
                f</span></div>
          </code></div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>(Earliest source I could find:
          <a href=3D"http://flamingdangerzone.com/cxx11/2013/03/11/overload=
-ranking.html" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=
=3D'http://www.google.com/url?q\75http%3A%2F%2Fflamingdangerzone.com%2Fcxx1=
1%2F2013%2F03%2F11%2Foverload-ranking.html\46sa\75D\46sntz\0751\46usg\75AFQ=
jCNG_NaVXICRVZXL-NkcCtsRzey0VRA';return true;" onclick=3D"this.href=3D'http=
://www.google.com/url?q\75http%3A%2F%2Fflamingdangerzone.com%2Fcxx11%2F2013=
%2F03%2F11%2Foverload-ranking.html\46sa\75D\46sntz\0751\46usg\75AFQjCNG_NaV=
XICRVZXL-NkcCtsRzey0VRA';return true;">http://flamingdangerzone.com/<wbr>cx=
x11/2013/03/11/overload-<wbr>ranking.html</a>
          )</div>
        <div><span style=3D"font-size:13px"><br>
          </span></div>
        <div><span style=3D"font-size:13px">Without the `Rank&lt;N&gt;`
            parameters, `x =3D o(0)` would be ambiguous. A ranked overload
            might also be useful for disambiguating overloads,
            especially when f or g is a transparent function object,
            like "std::less&lt;&gt;". I have a working version </span><a hr=
ef=3D"https://github.com/splinterofchaos/fu/blob/c8db291d60263b131cb0fce645=
874b4ce3e26baa/include/fu/functional.h#L109-L140" style=3D"font-size:13px" =
target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D'https://www.=
google.com/url?q\75https%3A%2F%2Fgithub.com%2Fsplinterofchaos%2Ffu%2Fblob%2=
Fc8db291d60263b131cb0fce645874b4ce3e26baa%2Finclude%2Ffu%2Ffunctional.h%23L=
109-L140\46sa\75D\46sntz\0751\46usg\75AFQjCNFSZIsCJUaK3ygXfE8q7J7FoIyVnQ';r=
eturn true;" onclick=3D"this.href=3D'https://www.google.com/url?q\75https%3=
A%2F%2Fgithub.com%2Fsplinterofchaos%2Ffu%2Fblob%2Fc8db291d60263b131cb0fce64=
5874b4ce3e26baa%2Finclude%2Ffu%2Ffunctional.h%23L109-L140\46sa\75D\46sntz\0=
751\46usg\75AFQjCNFSZIsCJUaK3ygXfE8q7J7FoIyVnQ';return true;">here</a><span=
 style=3D"font-size:13px">&nbsp;that&nbsp;</span>implicitly<span style=3D"f=
ont-size:13px">&nbsp;adds
            the rank parameter.</span></div>
      </div>
      <br>
    </blockquote>
    Hi,<br>
    <br>
    IIUC you are proposing an additional ranked_overload function that
    accepts optionally the rank, an defaults it to the first one, isn't
    it<br></div></blockquote><div><br></div><div>Sort of, but it needn't ac=
cept an optional rank, only Rank&lt;1&gt; and Rank&lt;0&gt; are needed beca=
use "ranked_overload" can be defined recursively.</div><div><br></div><div =
class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-w=
rap: break-word; background-color: rgb(250, 250, 250);"><code class=3D"pret=
typrint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> o </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> ranked_overload</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">([](</span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">int</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">int</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: #660;" =
class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">...</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">},</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;</span><span style=3D"color: #660;" class=3D"styled-by-prettify">[](<=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">float</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </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: #660;" class=3D"styled-by-prettify">},</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">[](</span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">auto</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: #008;" =
class=3D"styled-by-prettify">auto</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">...</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">});</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #8=
00;" class=3D"styled-by-prettify">// decltype(o) =3D RankedOverload&lt;F, R=
ankedOverload&lt;G,H&gt;&gt;</span></div></code></div><div><br></div><div>S=
o, "o(x,y)" invokes "o.call(Rank&lt;1&gt;(), x, y)" and if SFINAE forbids "=
[](int, int)", then it calls</div><div><br><div class=3D"prettyprint" style=
=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; background=
-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"subp=
rettyprint"><span style=3D"color: #000;" class=3D"styled-by-prettify">ranke=
d_overload</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
([](</span><span style=3D"color: #008;" class=3D"styled-by-prettify">float<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> aut</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">o</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">...</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">},</span><=
/div><div class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"></span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [](</span><=
span style=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">...</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">})(x,y);<br></span></div>=
</code></div><br></div><div>I suppose a version where each function would h=
ave a unique rank and an "operator()" overload that could accept a "Rank&lt=
;N&gt;" in order to specify which function to call would be possible, but I=
 don't see a use for that and it'd be a little bit harder to write. (I trie=
d that before I settled on just using "Rank&lt;1&gt;" and "&lt;0&gt;".)</di=
v><div><br></div><div>One gotcha that I've found about explicit overloading=
 like this is that if you pass in a function with the signature "[](auto&am=
p;&amp; x, auto&amp;&amp; y) {f(x,y);}" and while there may be a function o=
n the set considered a near match to "x" and "y", and "f" might require a c=
onversion of both, the signature binds to anything, thus hiding the convers=
ions in the body so they don't participate in overload resolution making it=
 appear as an exact match. That might surprise a few people. It's one examp=
le of when one might prefer a "ranked_overload".</div><div>&nbsp;</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;"><div bgcolor=3D"#FFFFFF" text=3D"#=
000000">
    <br>
    Vicente<br>
  </div>

</blockquote></div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_257_1123061403.1422213317709--
------=_Part_256_233252854.1422213317709--

.


Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Date: Mon, 2 Mar 2015 13:37:02 +0100
Raw View
2015-01-24 11:51 GMT+01:00 Vicente J. Botet Escriba <vicente.botet@wanadoo.=
fr>:
> Le 24/01/15 11:03, Douglas Boffey a =C3=A9crit :
>>
>> What is .md?
>
> GitHub MarkDown format https://help.github.com/articles/markdown-basics/
>>
>> Acceptable formats: .txt, .pdf, .htm(l) and .rtf.

Only the former three. rtf files do not belong to the accepted formats
for proposals, see "Call for Proposals",

http://open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3370.html

that is referred to by

https://isocpp.org/std/submit-a-proposal

> .md files a text only, would this be acceptable.

Please do not submit markdown files. We have not yet accepted any so
far and if you want to submit papers that take advantage of extended
text formatting, please submit pdf or html instead.

Thanks,

- Daniel

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.