Topic: Switch Argument Dependent Lookup (SADL)


Author: corentin.schreiber@cea.fr
Date: Sun, 6 Jul 2014 15:12:00 -0700 (PDT)
Raw View
------=_Part_125_32390727.1404684720668
Content-Type: text/plain; charset=UTF-8

Maybe this has been discussed before, but I could not find any trace of it.
I have uploaded a short text to propose the addition of a new lookup rule
for switch case labels:
https://github.com/cschreib/cpp/blob/master/sadl/sadl.md

This is not a proper proposal per say, I just wanted to post an informal
message here, but for some reason the Google Group interface refused to
send it.
I would be interested in knowing what you think about such an addition to
the language.

--

---
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_125_32390727.1404684720668
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Maybe this has been discussed before, but I could not find=
 any trace of it.<br>I have uploaded a short text to propose the addition o=
f a new lookup rule for switch case labels:<br>https://github.com/cschreib/=
cpp/blob/master/sadl/sadl.md<br><br>This is not a proper proposal per say, =
I just wanted to post an informal message here, but for some reason the Goo=
gle Group interface refused to send it.<br>I would be interested in knowing=
 what you think about such an addition to the language.<br><mytubeelement d=
ata=3D"{&quot;bundle&quot;:{&quot;label_delimitor&quot;:&quot;:&quot;,&quot=
;percentage&quot;:&quot;%&quot;,&quot;smart_buffer&quot;:&quot;Smart Buffer=
&quot;,&quot;start_playing_when_buffered&quot;:&quot;Start playing when buf=
fered&quot;,&quot;sound&quot;:&quot;Sound&quot;,&quot;desktop_notification&=
quot;:&quot;Desktop Notification&quot;,&quot;continuation_on_next_line&quot=
;:&quot;-&quot;,&quot;loop&quot;:&quot;Loop&quot;,&quot;only_notify&quot;:&=
quot;Only Notify&quot;,&quot;estimated_time&quot;:&quot;Estimated Time&quot=
;,&quot;global_preferences&quot;:&quot;Global Preferences&quot;,&quot;no_no=
tification_supported_on_your_browser&quot;:&quot;No notification style supp=
orted on your browser version&quot;,&quot;video_buffered&quot;:&quot;Video =
Buffered&quot;,&quot;buffered&quot;:&quot;Buffered&quot;,&quot;hyphen&quot;=
:&quot;-&quot;,&quot;buffered_message&quot;:&quot;The video has been buffer=
ed as requested and is ready to play.&quot;,&quot;not_supported&quot;:&quot=
;Not Supported&quot;,&quot;on&quot;:&quot;On&quot;,&quot;off&quot;:&quot;Of=
f&quot;,&quot;click_to_enable_for_this_site&quot;:&quot;Click to enable for=
 this site&quot;,&quot;desktop_notification_denied&quot;:&quot;You have den=
ied permission for desktop notification for this site&quot;,&quot;notificat=
ion_status_delimitor&quot;:&quot;;&quot;,&quot;error&quot;:&quot;Error&quot=
;,&quot;adblock_interferance_message&quot;:&quot;Adblock (or similar extens=
ion) is known to interfere with SmartVideo. Please add this url to adblock =
whitelist.&quot;,&quot;calculating&quot;:&quot;Calculating&quot;,&quot;wait=
ing&quot;:&quot;Waiting&quot;,&quot;will_start_buffering_when_initialized&q=
uot;:&quot;Will start buffering when initialized&quot;,&quot;will_start_pla=
ying_when_initialized&quot;:&quot;Will start playing when initialized&quot;=
,&quot;completed&quot;:&quot;Completed&quot;,&quot;buffering_stalled&quot;:=
&quot;Buffering is stalled. Will stop.&quot;,&quot;stopped&quot;:&quot;Stop=
ped&quot;,&quot;hr&quot;:&quot;Hr&quot;,&quot;min&quot;:&quot;Min&quot;,&qu=
ot;sec&quot;:&quot;Sec&quot;,&quot;any_moment&quot;:&quot;Any Moment&quot;,=
&quot;popup_donate_to&quot;:&quot;Donate to&quot;,&quot;extension_id&quot;:=
null},&quot;prefs&quot;:{&quot;desktopNotification&quot;:true,&quot;soundNo=
tification&quot;:false,&quot;logLevel&quot;:0,&quot;enable&quot;:true,&quot=
;loop&quot;:false,&quot;hidePopup&quot;:true,&quot;autoPlay&quot;:false,&qu=
ot;autoBuffer&quot;:false,&quot;autoPlayOnBuffer&quot;:false,&quot;autoPlay=
OnBufferPercentage&quot;:42,&quot;autoPlayOnSmartBuffer&quot;:true,&quot;qu=
ality&quot;:&quot;default&quot;,&quot;fshd&quot;:false,&quot;onlyNotificati=
on&quot;:true,&quot;enableFullScreen&quot;:true,&quot;saveBandwidth&quot;:f=
alse,&quot;hideAnnotations&quot;:true,&quot;turnOffPagedBuffering&quot;:tru=
e}}" event=3D"preferencesUpdated" id=3D"myTubeRelayElementToPage"></mytubee=
lement><mytubeelement data=3D"{&quot;loadBundle&quot;:true}" event=3D"relay=
Prefs" id=3D"myTubeRelayElementToTab"></mytubeelement></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_125_32390727.1404684720668--

.


Author: David Krauss <potswa@gmail.com>
Date: Mon, 7 Jul 2014 06:21:53 +0800
Raw View
--Apple-Mail=_E78D5EB2-0EC6-418B-B912-238774D68238
Content-Type: text/plain; charset=ISO-8859-1


On 2014-07-07, at 6:12 AM, corentin.schreiber@cea.fr wrote:

> Maybe this has been discussed before, but I could not find any trace of it.
> I have uploaded a short text to propose the addition of a new lookup rule for switch case labels:
> https://github.com/cschreib/cpp/blob/master/sadl/sadl.md
>
> This is not a proper proposal per say, I just wanted to post an informal message here, but for some reason the Google Group interface refused to send it.
> I would be interested in knowing what you think about such an addition to the language.

I think you've identified the general problem that scoped enumeration qualification is redundant when initializing an object of the given type.

However, in your case, you can simply declare the type inside the switch block.

    switch (p.reason) {
        using reason_t = packet::connection_failed::reason_t;

        // Handle all possible cases and react accordingly
        case reason_t::too_many_clients:

This eliminates the supposed local scope namespace pollution.

--

---
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/.

--Apple-Mail=_E78D5EB2-0EC6-418B-B912-238774D68238
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-=
mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 2014&=
ndash;07&ndash;07, at 6:12 AM, <a href=3D"mailto:corentin.schreiber@cea.fr"=
>corentin.schreiber@cea.fr</a> wrote:</div><br class=3D"Apple-interchange-n=
ewline"><blockquote type=3D"cite"><div dir=3D"ltr">Maybe this has been disc=
ussed before, but I could not find any trace of it.<br>I have uploaded a sh=
ort text to propose the addition of a new lookup rule for switch case label=
s:<br><a href=3D"https://github.com/cschreib/cpp/blob/master/sadl/sadl.md">=
https://github.com/cschreib/cpp/blob/master/sadl/sadl.md</a><br><br>This is=
 not a proper proposal per say, I just wanted to post an informal message h=
ere, but for some reason the Google Group interface refused to send it.<br>=
I would be interested in knowing what you think about such an addition to t=
he language.<br><mytubeelement data=3D"{&quot;bundle&quot;:{&quot;label_del=
imitor&quot;:&quot;:&quot;,&quot;percentage&quot;:&quot;%&quot;,&quot;smart=
_buffer&quot;:&quot;Smart Buffer&quot;,&quot;start_playing_when_buffered&qu=
ot;:&quot;Start playing when buffered&quot;,&quot;sound&quot;:&quot;Sound&q=
uot;,&quot;desktop_notification&quot;:&quot;Desktop Notification&quot;,&quo=
t;continuation_on_next_line&quot;:&quot;-&quot;,&quot;loop&quot;:&quot;Loop=
&quot;,&quot;only_notify&quot;:&quot;Only Notify&quot;,&quot;estimated_time=
&quot;:&quot;Estimated Time&quot;,&quot;global_preferences&quot;:&quot;Glob=
al Preferences&quot;,&quot;no_notification_supported_on_your_browser&quot;:=
&quot;No notification style supported on your browser version&quot;,&quot;v=
ideo_buffered&quot;:&quot;Video Buffered&quot;,&quot;buffered&quot;:&quot;B=
uffered&quot;,&quot;hyphen&quot;:&quot;-&quot;,&quot;buffered_message&quot;=
:&quot;The video has been buffered as requested and is ready to play.&quot;=
,&quot;not_supported&quot;:&quot;Not Supported&quot;,&quot;on&quot;:&quot;O=
n&quot;,&quot;off&quot;:&quot;Off&quot;,&quot;click_to_enable_for_this_site=
&quot;:&quot;Click to enable for this site&quot;,&quot;desktop_notification=
_denied&quot;:&quot;You have denied permission for desktop notification for=
 this site&quot;,&quot;notification_status_delimitor&quot;:&quot;;&quot;,&q=
uot;error&quot;:&quot;Error&quot;,&quot;adblock_interferance_message&quot;:=
&quot;Adblock (or similar extension) is known to interfere with SmartVideo.=
 Please add this url to adblock whitelist.&quot;,&quot;calculating&quot;:&q=
uot;Calculating&quot;,&quot;waiting&quot;:&quot;Waiting&quot;,&quot;will_st=
art_buffering_when_initialized&quot;:&quot;Will start buffering when initia=
lized&quot;,&quot;will_start_playing_when_initialized&quot;:&quot;Will star=
t playing when initialized&quot;,&quot;completed&quot;:&quot;Completed&quot=
;,&quot;buffering_stalled&quot;:&quot;Buffering is stalled. Will stop.&quot=
;,&quot;stopped&quot;:&quot;Stopped&quot;,&quot;hr&quot;:&quot;Hr&quot;,&qu=
ot;min&quot;:&quot;Min&quot;,&quot;sec&quot;:&quot;Sec&quot;,&quot;any_mome=
nt&quot;:&quot;Any Moment&quot;,&quot;popup_donate_to&quot;:&quot;Donate to=
&quot;,&quot;extension_id&quot;:null},&quot;prefs&quot;:{&quot;desktopNotif=
ication&quot;:true,&quot;soundNotification&quot;:false,&quot;logLevel&quot;=
:0,&quot;enable&quot;:true,&quot;loop&quot;:false,&quot;hidePopup&quot;:tru=
e,&quot;autoPlay&quot;:false,&quot;autoBuffer&quot;:false,&quot;autoPlayOnB=
uffer&quot;:false,&quot;autoPlayOnBufferPercentage&quot;:42,&quot;autoPlayO=
nSmartBuffer&quot;:true,&quot;quality&quot;:&quot;default&quot;,&quot;fshd&=
quot;:false,&quot;onlyNotification&quot;:true,&quot;enableFullScreen&quot;:=
true,&quot;saveBandwidth&quot;:false,&quot;hideAnnotations&quot;:true,&quot=
;turnOffPagedBuffering&quot;:true}}" event=3D"preferencesUpdated" id=3D"myT=
ubeRelayElementToPage"></mytubeelement><mytubeelement data=3D"{&quot;loadBu=
ndle&quot;:true}" event=3D"relayPrefs" id=3D"myTubeRelayElementToTab"></myt=
ubeelement></div></blockquote><br></div><div>I think you&rsquo;ve identifie=
d the general problem that scoped enumeration qualification is redundant wh=
en initializing an object of the given type.</div><br><div>However, in your=
 case, you can simply declare the type inside the switch block.</div><div><=
br></div><div><div><font face=3D"Courier">&nbsp; &nbsp; switch&nbsp;(p.reas=
on)&nbsp;{</font></div><font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; u=
sing&nbsp;reason_t&nbsp;=3D&nbsp;packet::connection_failed::reason_t;</font=
></div><div><font face=3D"Courier"><br></font><div><font face=3D"Courier">&=
nbsp; &nbsp; &nbsp; &nbsp; // Handle all possible cases and react according=
ly</font></div><div><font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; case=
&nbsp;reason_t::too_many_clients:</font></div></div><div><br></div><div>Thi=
s eliminates the supposed local scope namespace pollution.</div><div><br></=
div></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 />

--Apple-Mail=_E78D5EB2-0EC6-418B-B912-238774D68238--

.


Author: Corentin Schreiber <corentin.schreiber@cea.fr>
Date: Mon, 07 Jul 2014 01:26:35 +0200
Raw View
This is a multi-part message in MIME format.
--------------030706020909080603020201
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On Monday, July 7, 2014 12:22:06 AM UTC+2, David Krauss wrote:


    I think you've identified the general problem that scoped
    enumeration qualification is redundant when initializing an object
    of the given type.


You mean the same philosophy could apply to the following cases?
|
packet::connection_failed::reason_t rsn =too_many_clients;// [1]

voidfoo(packet::connection_failed::reason_t rsn);// [2]
foo(too_many_clients);
|

I believe case [1] is ok and straightforward, although it can still can
be replaced by
|
autorsn =|packet::connection_failed::reason_t::||too_many_clients;|
|
This is not applicable to member initializer lists though.

Case [2] can be tricky to mix with overload resolution and template type
deduction, but that should be doable as well. Is it worth the trouble, I
don't know. The switch however is probably where enums are used most, so
I would think there is a substantial amount of clarity to be gained here
for very little cost.

    However, in your case, you can simply declare the type inside the
    switch block.

         switch (p.reason) {
             using reason_t = packet::connection_failed::reason_t;

             // Handle all possible cases and react accordingly
             case reason_t::too_many_clients:

    This eliminates the supposed local scope namespace pollution.


That's true, I didn't realize you could do that. Now that is still some
unnecessary typing, given that the actual type of 'p.reason' is known to
the compiler.

--

---
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/.

--------------030706020909080603020201
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3DISO-8859-1"
      http-equiv=3D"Content-Type">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    On Monday, July 7, 2014 12:22:06 AM UTC+2, David Krauss wrote:
    <blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:
      0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
      <div style=3D"word-wrap:break-word"><br>
        <div>I think you&#8217;ve identified the general problem that scope=
d
          enumeration qualification is redundant when initializing an
          object of the given type.</div>
      </div>
    </blockquote>
    <div><br>
      You mean the same philosophy could apply to the following cases?<br>
      <div class=3D"prettyprint" 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
          class=3D"prettyprint">
          <div class=3D"subprettyprint"><span style=3D"color: #000;"
              class=3D"styled-by-prettify">packet</span><span
              style=3D"color: #660;" class=3D"styled-by-prettify">::</span>=
<span
              style=3D"color: #000;" class=3D"styled-by-prettify">connectio=
n_failed</span><span
              style=3D"color: #660;" class=3D"styled-by-prettify">::</span>=
<span
              style=3D"color: #000;" class=3D"styled-by-prettify">reason_t
              rsn </span><span style=3D"color: #660;"
              class=3D"styled-by-prettify">=3D</span><span style=3D"color:
              #000;" class=3D"styled-by-prettify"> too_many_clients</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-by-prettify">// [1]</s=
pan><span
              style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              <br>
            </span><span style=3D"color: #008;" class=3D"styled-by-prettify=
">void</span><span
              style=3D"color: #000;" class=3D"styled-by-prettify"> foo</spa=
n><span
              style=3D"color: #660;" class=3D"styled-by-prettify">(</span><=
span
              style=3D"color: #000;" class=3D"styled-by-prettify">packet</s=
pan><span
              style=3D"color: #660;" class=3D"styled-by-prettify">::</span>=
<span
              style=3D"color: #000;" class=3D"styled-by-prettify">connectio=
n_failed</span><span
              style=3D"color: #660;" class=3D"styled-by-prettify">::</span>=
<span
              style=3D"color: #000;" class=3D"styled-by-prettify">reason_t
              rsn</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-by-prettify">// [2]</s=
pan><span
              style=3D"color: #000;" class=3D"styled-by-prettify"><br>
              foo</span><span style=3D"color: #660;"
              class=3D"styled-by-prettify">(</span><span style=3D"color:
              #000;" class=3D"styled-by-prettify">too_many_clients</span><s=
pan
              style=3D"color: #660;" class=3D"styled-by-prettify">);</span>=
<span
              style=3D"color: #000;" class=3D"styled-by-prettify"><br>
            </span></div>
        </code></div>
      <br>
      I believe case [1] is ok and straightforward, although it can
      still can be replaced by<br>
      <div class=3D"prettyprint" 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
          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"> rsn </span><span
              style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span=
><code
              class=3D"prettyprint"><span style=3D"color: #000;"
                class=3D"styled-by-prettify"> packet</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify">connect=
ion_failed</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span
                style=3D"color: #000;" class=3D"styled-by-prettify">reason_=
t::</span></code><code
              class=3D"prettyprint"><span style=3D"color: #000;"
                class=3D"styled-by-prettify">too_many_clients</span><span
                style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
></code></div>
        </code></div>
      This is not applicable to member initializer lists though.<br>
      <br>
      Case [2] can be tricky to mix with overload resolution and
      template type deduction, but that should be doable as well. Is it
      worth the trouble, I don't know. The switch however is probably
      where enums are used most, so I would think there is a substantial
      amount of clarity to be gained here for very little cost.<br>
      &nbsp;</div>
    <blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:
      0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
      <div style=3D"word-wrap:break-word">
        <div>However, in your case, you can simply declare the type
          inside the switch block.</div>
        <div><br>
        </div>
        <div>
          <div><font face=3D"Courier">&nbsp; &nbsp; switch&nbsp;(p.reason)&=
nbsp;{</font></div>
          <font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; using&nbsp;rea=
son_t&nbsp;=3D&nbsp;packet::<wbr>connection_failed::reason_t;</font></div>
        <div><font face=3D"Courier"><br>
          </font>
          <div><font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; // Handle=
 all possible cases
              and react accordingly</font></div>
          <div><font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; case&nbsp=
;reason_t::too_many_<wbr>clients:</font></div>
        </div>
        <div><br>
        </div>
        <div>This eliminates the supposed local scope namespace
          pollution.</div>
      </div>
    </blockquote>
    <div><br>
      That's true, I didn't realize you could do that. Now that is still
      some unnecessary typing, given that the actual type of 'p.reason'
      is known to the compiler.<br>
      &nbsp;</div>
    <mytubeelement
      data=3D"{&quot;bundle&quot;:{&quot;label_delimitor&quot;:&quot;:&quot=
;,&quot;percentage&quot;:&quot;%&quot;,&quot;smart_buffer&quot;:&quot;Smart

      Buffer&quot;,&quot;start_playing_when_buffered&quot;:&quot;Start
      playing when
      buffered&quot;,&quot;sound&quot;:&quot;Sound&quot;,&quot;desktop_noti=
fication&quot;:&quot;Desktop

      Notification&quot;,&quot;continuation_on_next_line&quot;:&quot;-&quot=
;,&quot;loop&quot;:&quot;Loop&quot;,&quot;only_notify&quot;:&quot;Only

      Notify&quot;,&quot;estimated_time&quot;:&quot;Estimated
      Time&quot;,&quot;global_preferences&quot;:&quot;Global
      Preferences&quot;,&quot;no_notification_supported_on_your_browser&quo=
t;:&quot;No

      notification style supported on your browser
      version&quot;,&quot;video_buffered&quot;:&quot;Video
      Buffered&quot;,&quot;buffered&quot;:&quot;Buffered&quot;,&quot;hyphen=
&quot;:&quot;-&quot;,&quot;buffered_message&quot;:&quot;The

      video has been buffered as requested and is ready to
      play.&quot;,&quot;not_supported&quot;:&quot;Not
      Supported&quot;,&quot;on&quot;:&quot;On&quot;,&quot;off&quot;:&quot;O=
ff&quot;,&quot;click_to_enable_for_this_site&quot;:&quot;Click

      to enable for this
      site&quot;,&quot;desktop_notification_denied&quot;:&quot;You have
      denied permission for desktop notification for this
      site&quot;,&quot;notification_status_delimitor&quot;:&quot;;&quot;,&q=
uot;error&quot;:&quot;Error&quot;,&quot;adblock_interferance_message&quot;:=
&quot;Adblock

      (or similar extension) is known to interfere with SmartVideo.
      Please add this url to adblock
      whitelist.&quot;,&quot;calculating&quot;:&quot;Calculating&quot;,&quo=
t;waiting&quot;:&quot;Waiting&quot;,&quot;will_start_buffering_when_initial=
ized&quot;:&quot;Will

      start buffering when
      initialized&quot;,&quot;will_start_playing_when_initialized&quot;:&qu=
ot;Will

      start playing when
      initialized&quot;,&quot;completed&quot;:&quot;Completed&quot;,&quot;b=
uffering_stalled&quot;:&quot;Buffering

      is stalled. Will
      stop.&quot;,&quot;stopped&quot;:&quot;Stopped&quot;,&quot;hr&quot;:&q=
uot;Hr&quot;,&quot;min&quot;:&quot;Min&quot;,&quot;sec&quot;:&quot;Sec&quot=
;,&quot;any_moment&quot;:&quot;Any

      Moment&quot;,&quot;popup_donate_to&quot;:&quot;Donate
to&quot;,&quot;extension_id&quot;:null},&quot;prefs&quot;:{&quot;desktopNot=
ification&quot;:true,&quot;soundNotification&quot;:false,&quot;logLevel&quo=
t;:0,&quot;enable&quot;:true,&quot;loop&quot;:false,&quot;hidePopup&quot;:t=
rue,&quot;autoPlay&quot;:false,&quot;autoBuffer&quot;:false,&quot;autoPlayO=
nBuffer&quot;:false,&quot;autoPlayOnBufferPercentage&quot;:42,&quot;autoPla=
yOnSmartBuffer&quot;:true,&quot;quality&quot;:&quot;default&quot;,&quot;fsh=
d&quot;:false,&quot;onlyNotification&quot;:true,&quot;enableFullScreen&quot=
;:true,&quot;saveBandwidth&quot;:false,&quot;hideAnnotations&quot;:true,&qu=
ot;turnOffPagedBuffering&quot;:true}}"
      event=3D"preferencesUpdated" id=3D"myTubeRelayElementToPage"></mytube=
element><mytubeelement
      data=3D"{&quot;loadBundle&quot;:true}" event=3D"relayPrefs"
      id=3D"myTubeRelayElementToTab"></mytubeelement>
  </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 />

--------------030706020909080603020201--

.


Author: David Krauss <potswa@gmail.com>
Date: Mon, 7 Jul 2014 07:56:26 +0800
Raw View
--Apple-Mail=_F76A9250-AB72-43AB-B32B-BF2ADA2FF4A6
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1


On 2014-07-07, at 7:26 AM, Corentin Schreiber <corentin.schreiber@cea.fr> w=
rote:

> I believe case [1] is ok and straightforward, although it can still can b=
e replaced by
> auto rsn =3D packet::connection_failed::reason_t::too_many_clients;
> This is not applicable to member initializer lists though.

Yes, auto is generally a bit brittle.

> Case [2] can be tricky to mix with overload resolution and template type =
deduction, but that should be doable as well. Is it worth the trouble, I do=
n't know.

I think function arguments are the most common case. There was some discuss=
ion here a while back, "function-local enumerators." An almost-equivalent f=
eature was proposed independent of the other cases of enumeration initializ=
ation. Yes, it's tricky to mix with overload resolution. I think it would b=
e worth the trouble, but a better approach to feature proposal might be to =
elaborate the simpler cases first, and then suggest overloading as a future=
 direction.

Since function-call and braced-ini-list syntaxes are both used roughly equi=
valently to initialize objects, ideally they should work the same way.

> The switch however is probably where enums are used most, so I would thin=
k there is a substantial amount of clarity to be gained here for very littl=
e cost.

Well, many folks simply never use switch.

> That's true, I didn't realize you could do that. Now that is still some u=
nnecessary typing, given that the actual type of 'p.reason' is known to the=
 compiler.

OK, you can say using reason_t =3D decltype(p.reason);. If you're feeling r=
eally meta, you can make a macro:

#define E_SWITCH( EXPR ) \
    switch( EXPR ) { \
        typedef decltype( EXPR ) case_t;

This only works for controlling expressions, not declarations.

--=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/.

--Apple-Mail=_F76A9250-AB72-43AB-B32B-BF2ADA2FF4A6
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-=
mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 2014&=
ndash;07&ndash;07, at 7:26 AM, Corentin Schreiber &lt;<a href=3D"mailto:cor=
entin.schreiber@cea.fr">corentin.schreiber@cea.fr</a>&gt; wrote:</div><br c=
lass=3D"Apple-interchange-newline"><blockquote type=3D"cite">
 =20
    <meta content=3D"text/html; charset=3DISO-8859-1" http-equiv=3D"Content=
-Type">
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000"><div>I believe case [1] is ok a=
nd straightforward, although it can
      still can be replaced by<br>
      <div class=3D"prettyprint" 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 class=3D"prettypri=
nt">
          <div class=3D"subprettyprint"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">auto</span><span style=3D"" class=3D"styled-by-pret=
tify"> rsn </span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>=3D</span><code class=3D"prettyprint"><span style=3D"" class=3D"styled-by-=
prettify"> packet</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">::</span><span style=3D"" class=3D"styled-by-prettify">connection_fa=
iled</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</sp=
an><span style=3D"" class=3D"styled-by-prettify">reason_t::</span></code><c=
ode class=3D"prettyprint"><span style=3D"" class=3D"styled-by-prettify">too=
_many_clients</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">;</span></code></div>
        </code></div>
      This is not applicable to member initializer lists though.<br></div><=
/div></blockquote><div><br></div><div>Yes, <font face=3D"Courier">auto</fon=
t> is generally a bit brittle.</div><br><blockquote type=3D"cite"><div bgco=
lor=3D"#FFFFFF" text=3D"#000000"><div>
     =20
      Case [2] can be tricky to mix with overload resolution and
      template type deduction, but that should be doable as well. Is it
      worth the trouble, I don't know.</div></div></blockquote><div><br></d=
iv><div>I think function arguments are the most common case. There was some=
 discussion here a while back, &ldquo;function-local enumerators.&rdquo; An=
 almost-equivalent feature was proposed independent of the other cases of e=
numeration initialization. Yes, it&rsquo;s tricky to mix with overload reso=
lution. I think it would be worth the trouble, but a better approach to fea=
ture proposal might be to elaborate the simpler cases first, and then sugge=
st overloading as a future direction.</div><div><br></div><div>Since functi=
on-call and braced-ini-list syntaxes are both used roughly equivalently to =
initialize objects, ideally they should work the same way.</div><br><blockq=
uote type=3D"cite"><div bgcolor=3D"#FFFFFF" text=3D"#000000"><div>The switc=
h however is probably
      where enums are used most, so I would think there is a substantial
      amount of clarity to be gained here for very little cost.<br></div></=
div></blockquote><div><br></div><div>Well, many folks simply never use <fon=
t face=3D"Courier">switch</font>.</div><br><blockquote type=3D"cite"><div b=
gcolor=3D"#FFFFFF" text=3D"#000000"><div>That's true, I didn't realize you =
could do that. Now that is still
      some unnecessary typing, given that the actual type of 'p.reason'
      is known to the compiler.</div></div></blockquote><br></div><div>OK, =
you can say <font face=3D"Courier">using reason_t =3D decltype(p.reason);</=
font>. If you&rsquo;re feeling really meta, you can make a macro:</div><div=
><br></div><div><font face=3D"Courier">#define E_SWITCH( EXPR ) \</font></d=
iv><div><font face=3D"Courier">&nbsp; &nbsp; switch( EXPR ) { \</font></div=
><div><font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; typedef decltype( =
EXPR ) case_t;</font></div><div><br></div>This only works for controlling e=
xpressions, not declarations.<div><br></div></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 />

--Apple-Mail=_F76A9250-AB72-43AB-B32B-BF2ADA2FF4A6--

.


Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Mon, 7 Jul 2014 03:30:05 -0700 (PDT)
Raw View
------=_Part_145_17735461.1404729005179
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


On Monday, 7 July 2014 00:56:39 UTC+1, David Krauss wrote:

>  OK, you can say using reason_t =3D decltype(p.reason);. If you=E2=80=99r=
e feeling=20
> really meta, you can make a macro:
>
> #define E_SWITCH( EXPR ) \
>     switch( EXPR ) { \
>         typedef decltype( EXPR ) case_t;
>
> This only works for controlling expressions, not declarations.=20
>
> Hmm, so any use of E_SWITCH would necessitate an unmatched close brace?
=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_145_17735461.1404729005179
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><DIV><BR>On Monday, 7 July 2014 00:56:39 UTC+1, David Krau=
ss wrote:</DIV>
<BLOCKQUOTE style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3Dgmail_quote>
<DIV style=3D"WORD-WRAP: break-word">
<DIV>OK, you can say <FONT face=3DCourier>using reason_t =3D decltype(p.rea=
son);</FONT>. If you=E2=80=99re feeling really meta, you can make a macro:<=
/DIV>
<DIV><BR></DIV>
<DIV><FONT face=3DCourier>#define E_SWITCH( EXPR ) \</FONT></DIV>
<DIV><FONT face=3DCourier>&nbsp; &nbsp; switch( EXPR ) { \</FONT></DIV>
<DIV><FONT face=3DCourier>&nbsp; &nbsp; &nbsp; &nbsp; typedef decltype( EXP=
R ) case_t;</FONT></DIV>
<DIV><BR></DIV>This only works for controlling expressions, not declaration=
s.=20
<DIV><BR></DIV></DIV></BLOCKQUOTE>
<DIV>Hmm, so any use of E_SWITCH would necessitate an unmatched close brace=
?</DIV>
<DIV>&nbsp;</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_145_17735461.1404729005179--

.


Author: David Krauss <potswa@gmail.com>
Date: Mon, 7 Jul 2014 18:47:35 +0800
Raw View
--Apple-Mail=_84D44EBF-720A-4E64-9407-C373BB24DE9F
Content-Type: text/plain; charset=ISO-8859-1


On 2014-07-07, at 6:30 PM, Douglas Boffey <douglas.boffey@gmail.com> wrote:

>
> On Monday, 7 July 2014 00:56:39 UTC+1, David Krauss wrote:
> OK, you can say using reason_t = decltype(p.reason);. If you're feeling really meta, you can make a macro:
>
> #define E_SWITCH( EXPR ) \
>     switch( EXPR ) { \
>         typedef decltype( EXPR ) case_t;
>
> This only works for controlling expressions, not declarations.
>
> Hmm, so any use of E_SWITCH would necessitate an unmatched close brace?

I'm not being particularly serious. Actually doing this sort of thing involves a game-plan to make it usable. However, it is significant that the boilerplate is reduced to something tractable even to the preprocessor.

--

---
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/.

--Apple-Mail=_84D44EBF-720A-4E64-9407-C373BB24DE9F
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-=
mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 2014&=
ndash;07&ndash;07, at 6:30 PM, Douglas Boffey &lt;<a href=3D"mailto:douglas=
..boffey@gmail.com">douglas.boffey@gmail.com</a>&gt; wrote:</div><br class=
=3D"Apple-interchange-newline"><blockquote type=3D"cite"><div dir=3D"ltr"><=
div><br>On Monday, 7 July 2014 00:56:39 UTC+1, David Krauss wrote:</div>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div style=3D"WORD-WRAP: break-word">
<div>OK, you can say <font face=3D"Courier">using reason_t =3D decltype(p.r=
eason);</font>. If you&rsquo;re feeling really meta, you can make a macro:<=
/div>
<div><br></div>
<div><font face=3D"Courier">#define E_SWITCH( EXPR ) \</font></div>
<div><font face=3D"Courier">&nbsp; &nbsp; switch( EXPR ) { \</font></div>
<div><font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; typedef decltype( E=
XPR ) case_t;</font></div>
<div><br></div>This only works for controlling expressions, not declaration=
s.=20
<div><br></div></div></blockquote>
<div>Hmm, so any use of E_SWITCH would necessitate an unmatched close brace=
?</div>
</div></blockquote><br></div><div>I&rsquo;m not being particularly serious.=
 Actually doing this sort of thing involves a game-plan to make it usable. =
However, it is significant that the boilerplate is reduced to something tra=
ctable even to the preprocessor.</div><div><br></div></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 />

--Apple-Mail=_84D44EBF-720A-4E64-9407-C373BB24DE9F--

.