Topic: auto(this) method qualifier: factorizing method's cv qualifiers


Author: bastienpenava@gmail.com
Date: Sun, 12 Nov 2017 00:57:23 -0800 (PST)
Raw View
------=_Part_3876_105878913.1510477043974
Content-Type: multipart/alternative;
 boundary="----=_Part_3877_1959003995.1510477043975"

------=_Part_3877_1959003995.1510477043975
Content-Type: text/plain; charset="UTF-8"

Hi,

the idea is simple, it's to add a "auto(this)" generative method qualifier
that would factorizes const, non-const, lvalue and rvalue cv qualifiers.
It would look something like this:

constexpr auto &operator[](size_t index) auto(this)
{
   //might use std::is_const_v<decltype(this)> to fine tool for instance.
   //...
}

And would produce the following methods (if not user-defined):
constexpr auto &operator[](size_t index) const & { ... }
constexpr auto &operator[](size_t index] & { ... }
constexpr auto &operator[](size_t index) && { ... }

As of the reason why, It's to avoid this:

struct C {
  const char & get() const {
    return c;
  }
  char & get() {
    return const_cast<char &>(static_cast<const C &>(*this).get());
  }
  char c;};


This code snippet comes from Scott Meyers' "Effective C++" and is still the
current one of the "best" solutions.
The other being simply to copy paste the method and changing the cv
qualifier.

--
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/5a99fc6b-316a-4958-a240-9304663aa6af%40isocpp.org.

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

<div dir=3D"ltr">Hi,<div><br></div><div>the idea is simple, it&#39;s to add=
 a &quot;auto(this)&quot; generative method qualifier that would factorizes=
 const, non-const, lvalue and rvalue cv qualifiers.</div><div>It would look=
 something like this:</div><div><br></div><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 clas=
s=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;=
" class=3D"styled-by-prettify">constexpr</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: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">&amp;</span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>operator</span><span style=3D"color: #660;" class=3D"styled-by-prettify">[=
](</span><span style=3D"color: #000;" class=3D"styled-by-prettify">size_t i=
ndex</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=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=
: #008;" class=3D"styled-by-prettify">this</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"st=
yled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br>=C2=A0 =C2=A0</span><span style=3D"color: #800;" class=3D"styl=
ed-by-prettify">//might use std::is_const_v&lt;decltype(this)&gt; to fine t=
ool for instance.</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br>=C2=A0 =C2=A0</span><span style=3D"color: #800;" class=3D"styled=
-by-prettify">//...</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">}</span></div></code></div><div><br></div><div>And would produce the fol=
lowing methods (if not user-defined):</div><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 clas=
s=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;=
" class=3D"styled-by-prettify">constexpr</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: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">&amp;</span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>operator</span><span style=3D"color: #660;" class=3D"styled-by-prettify">[=
](</span><span style=3D"color: #000;" class=3D"styled-by-prettify">size_t i=
ndex</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">const</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #00=
0;" 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><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">constexpr</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">&amp;</span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">operator</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">[](</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify">size_t index</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">&amp;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan 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"style=
d-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">constexpr</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">a=
uto</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">operator</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">[](</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">size_t index</span><span sty=
le=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: #660;=
" class=3D"styled-by-prettify">&amp;&amp;</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><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></=
code></div><div><br></div><div>As of the reason why, It&#39;s to avoid this=
:</div><div><br></div><div><pre class=3D"lang-cpp prettyprint prettyprinted=
" style=3D"padding: 5px; font-variant-numeric: inherit; font-stretch: inher=
it; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucid=
a Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;,=
 &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, =
sans-serif; vertical-align: baseline; width: auto; max-height: 600px; overf=
low: auto; background-color: rgb(239, 240, 241); color: rgb(57, 51, 24); wo=
rd-wrap: normal;"><code style=3D"font-style: inherit; font-variant: inherit=
; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-f=
amily: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberatio=
n Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&=
quot;, &quot;Courier New&quot;, monospace, sans-serif; vertical-align: base=
line; white-space: inherit;"><span class=3D"kwd" style=3D"font-style: inher=
it; font-variant: inherit; font-weight: inherit; font-stretch: inherit; fon=
t-size: inherit; line-height: inherit; font-family: inherit; vertical-align=
: baseline; color: rgb(16, 16, 148);">struct</span><span class=3D"pln" styl=
e=3D"font-style: inherit; font-variant: inherit; font-weight: inherit; font=
-stretch: inherit; font-size: inherit; line-height: inherit; font-family: i=
nherit; vertical-align: baseline; color: rgb(48, 51, 54);"> C </span><span =
class=3D"pun" style=3D"font-style: inherit; font-variant: inherit; font-wei=
ght: inherit; font-stretch: inherit; font-size: inherit; line-height: inher=
it; font-family: inherit; vertical-align: baseline; color: rgb(48, 51, 54);=
">{</span><span class=3D"pln" style=3D"font-style: inherit; font-variant: i=
nherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; li=
ne-height: inherit; font-family: inherit; vertical-align: baseline; color: =
rgb(48, 51, 54);">
  </span><span class=3D"kwd" style=3D"font-style: inherit; font-variant: in=
herit; font-weight: inherit; font-stretch: inherit; font-size: inherit; lin=
e-height: inherit; font-family: inherit; vertical-align: baseline; color: r=
gb(16, 16, 148);">const</span><span class=3D"pln" style=3D"font-style: inhe=
rit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; fo=
nt-size: inherit; line-height: inherit; font-family: inherit; vertical-alig=
n: baseline; color: rgb(48, 51, 54);"> </span><span class=3D"kwd" style=3D"=
font-style: inherit; font-variant: inherit; font-weight: inherit; font-stre=
tch: inherit; font-size: inherit; line-height: inherit; font-family: inheri=
t; vertical-align: baseline; color: rgb(16, 16, 148);">char</span><span cla=
ss=3D"pln" style=3D"font-style: inherit; font-variant: inherit; font-weight=
: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit;=
 font-family: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> =
</span><span class=3D"pun" style=3D"font-style: inherit; font-variant: inhe=
rit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-=
height: inherit; font-family: inherit; vertical-align: baseline; color: rgb=
(48, 51, 54);">&amp;</span><span class=3D"pln" style=3D"font-style: inherit=
; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-=
size: inherit; line-height: inherit; font-family: inherit; vertical-align: =
baseline; color: rgb(48, 51, 54);"> get</span><span class=3D"pun" style=3D"=
font-style: inherit; font-variant: inherit; font-weight: inherit; font-stre=
tch: inherit; font-size: inherit; line-height: inherit; font-family: inheri=
t; vertical-align: baseline; color: rgb(48, 51, 54);">()</span><span class=
=3D"pln" style=3D"font-style: inherit; font-variant: inherit; font-weight: =
inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; f=
ont-family: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> </=
span><span class=3D"kwd" style=3D"font-style: inherit; font-variant: inheri=
t; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-he=
ight: inherit; font-family: inherit; vertical-align: baseline; color: rgb(1=
6, 16, 148);">const</span><span class=3D"pln" style=3D"font-style: inherit;=
 font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-s=
ize: inherit; line-height: inherit; font-family: inherit; vertical-align: b=
aseline; color: rgb(48, 51, 54);"> </span><span class=3D"pun" style=3D"font=
-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch:=
 inherit; font-size: inherit; line-height: inherit; font-family: inherit; v=
ertical-align: baseline; color: rgb(48, 51, 54);">{</span><span class=3D"pl=
n" style=3D"font-style: inherit; font-variant: inherit; font-weight: inheri=
t; font-stretch: inherit; font-size: inherit; line-height: inherit; font-fa=
mily: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
    </span><span class=3D"kwd" style=3D"font-style: inherit; font-variant: =
inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; l=
ine-height: inherit; font-family: inherit; vertical-align: baseline; color:=
 rgb(16, 16, 148);">return</span><span class=3D"pln" style=3D"font-style: i=
nherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit;=
 font-size: inherit; line-height: inherit; font-family: inherit; vertical-a=
lign: baseline; color: rgb(48, 51, 54);"> c</span><span class=3D"pun" style=
=3D"font-style: inherit; font-variant: inherit; font-weight: inherit; font-=
stretch: inherit; font-size: inherit; line-height: inherit; font-family: in=
herit; vertical-align: baseline; color: rgb(48, 51, 54);">;</span><span cla=
ss=3D"pln" style=3D"font-style: inherit; font-variant: inherit; font-weight=
: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit;=
 font-family: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
  </span><span class=3D"pun" style=3D"font-style: inherit; font-variant: in=
herit; font-weight: inherit; font-stretch: inherit; font-size: inherit; lin=
e-height: inherit; font-family: inherit; vertical-align: baseline; color: r=
gb(48, 51, 54);">}</span><span class=3D"pln" style=3D"font-style: inherit; =
font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-si=
ze: inherit; line-height: inherit; font-family: inherit; vertical-align: ba=
seline; color: rgb(48, 51, 54);">
  </span><span class=3D"kwd" style=3D"font-style: inherit; font-variant: in=
herit; font-weight: inherit; font-stretch: inherit; font-size: inherit; lin=
e-height: inherit; font-family: inherit; vertical-align: baseline; color: r=
gb(16, 16, 148);">char</span><span class=3D"pln" style=3D"font-style: inher=
it; font-variant: inherit; font-weight: inherit; font-stretch: inherit; fon=
t-size: inherit; line-height: inherit; font-family: inherit; vertical-align=
: baseline; color: rgb(48, 51, 54);"> </span><span class=3D"pun" style=3D"f=
ont-style: inherit; font-variant: inherit; font-weight: inherit; font-stret=
ch: inherit; font-size: inherit; line-height: inherit; font-family: inherit=
; vertical-align: baseline; color: rgb(48, 51, 54);">&amp;</span><span clas=
s=3D"pln" style=3D"font-style: inherit; font-variant: inherit; font-weight:=
 inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; =
font-family: inherit; vertical-align: baseline; color: rgb(48, 51, 54);"> g=
et</span><span class=3D"pun" style=3D"font-style: inherit; font-variant: in=
herit; font-weight: inherit; font-stretch: inherit; font-size: inherit; lin=
e-height: inherit; font-family: inherit; vertical-align: baseline; color: r=
gb(48, 51, 54);">()</span><span class=3D"pln" style=3D"font-style: inherit;=
 font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-s=
ize: inherit; line-height: inherit; font-family: inherit; vertical-align: b=
aseline; color: rgb(48, 51, 54);"> </span><span class=3D"pun" style=3D"font=
-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch:=
 inherit; font-size: inherit; line-height: inherit; font-family: inherit; v=
ertical-align: baseline; color: rgb(48, 51, 54);">{</span><span class=3D"pl=
n" style=3D"font-style: inherit; font-variant: inherit; font-weight: inheri=
t; font-stretch: inherit; font-size: inherit; line-height: inherit; font-fa=
mily: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
    </span><span class=3D"kwd" style=3D"font-style: inherit; font-variant: =
inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; l=
ine-height: inherit; font-family: inherit; vertical-align: baseline; color:=
 rgb(16, 16, 148);">return</span><span class=3D"pln" style=3D"font-style: i=
nherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit;=
 font-size: inherit; line-height: inherit; font-family: inherit; vertical-a=
lign: baseline; color: rgb(48, 51, 54);"> </span><span class=3D"kwd" style=
=3D"font-style: inherit; font-variant: inherit; font-weight: inherit; font-=
stretch: inherit; font-size: inherit; line-height: inherit; font-family: in=
herit; vertical-align: baseline; color: rgb(16, 16, 148);">const_cast</span=
><span class=3D"pun" style=3D"font-style: inherit; font-variant: inherit; f=
ont-weight: inherit; font-stretch: inherit; font-size: inherit; line-height=
: inherit; font-family: inherit; vertical-align: baseline; color: rgb(48, 5=
1, 54);">&lt;</span><span class=3D"kwd" style=3D"font-style: inherit; font-=
variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: i=
nherit; line-height: inherit; font-family: inherit; vertical-align: baselin=
e; color: rgb(16, 16, 148);">char</span><span class=3D"pln" style=3D"font-s=
tyle: inherit; font-variant: inherit; font-weight: inherit; font-stretch: i=
nherit; font-size: inherit; line-height: inherit; font-family: inherit; ver=
tical-align: baseline; color: rgb(48, 51, 54);"> </span><span class=3D"pun"=
 style=3D"font-style: inherit; font-variant: inherit; font-weight: inherit;=
 font-stretch: inherit; font-size: inherit; line-height: inherit; font-fami=
ly: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">&amp;&gt;(<=
/span><span class=3D"kwd" style=3D"font-style: inherit; font-variant: inher=
it; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-h=
eight: inherit; font-family: inherit; vertical-align: baseline; color: rgb(=
16, 16, 148);">static_cast</span><span class=3D"pun" style=3D"font-style: i=
nherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit;=
 font-size: inherit; line-height: inherit; font-family: inherit; vertical-a=
lign: baseline; color: rgb(48, 51, 54);">&lt;</span><span class=3D"kwd" sty=
le=3D"font-style: inherit; font-variant: inherit; font-weight: inherit; fon=
t-stretch: inherit; font-size: inherit; line-height: inherit; font-family: =
inherit; vertical-align: baseline; color: rgb(16, 16, 148);">const</span><s=
pan class=3D"pln" style=3D"font-style: inherit; font-variant: inherit; font=
-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: i=
nherit; font-family: inherit; vertical-align: baseline; color: rgb(48, 51, =
54);"> C </span><span class=3D"pun" style=3D"font-style: inherit; font-vari=
ant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inher=
it; line-height: inherit; font-family: inherit; vertical-align: baseline; c=
olor: rgb(48, 51, 54);">&amp;&gt;(*</span><span class=3D"kwd" style=3D"font=
-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch:=
 inherit; font-size: inherit; line-height: inherit; font-family: inherit; v=
ertical-align: baseline; color: rgb(16, 16, 148);">this</span><span class=
=3D"pun" style=3D"font-style: inherit; font-variant: inherit; font-weight: =
inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; f=
ont-family: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">).<=
/span><span class=3D"pln" style=3D"font-style: inherit; font-variant: inher=
it; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-h=
eight: inherit; font-family: inherit; vertical-align: baseline; color: rgb(=
48, 51, 54);">get</span><span class=3D"pun" style=3D"font-style: inherit; f=
ont-variant: inherit; font-weight: inherit; font-stretch: inherit; font-siz=
e: inherit; line-height: inherit; font-family: inherit; vertical-align: bas=
eline; color: rgb(48, 51, 54);">());</span><span class=3D"pln" style=3D"fon=
t-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch=
: inherit; font-size: inherit; line-height: inherit; font-family: inherit; =
vertical-align: baseline; color: rgb(48, 51, 54);">
  </span><span class=3D"pun" style=3D"font-style: inherit; font-variant: in=
herit; font-weight: inherit; font-stretch: inherit; font-size: inherit; lin=
e-height: inherit; font-family: inherit; vertical-align: baseline; color: r=
gb(48, 51, 54);">}</span><span class=3D"pln" style=3D"font-style: inherit; =
font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-si=
ze: inherit; line-height: inherit; font-family: inherit; vertical-align: ba=
seline; color: rgb(48, 51, 54);">
  </span><span class=3D"kwd" style=3D"font-style: inherit; font-variant: in=
herit; font-weight: inherit; font-stretch: inherit; font-size: inherit; lin=
e-height: inherit; font-family: inherit; vertical-align: baseline; color: r=
gb(16, 16, 148);">char</span><span class=3D"pln" style=3D"font-style: inher=
it; font-variant: inherit; font-weight: inherit; font-stretch: inherit; fon=
t-size: inherit; line-height: inherit; font-family: inherit; vertical-align=
: baseline; color: rgb(48, 51, 54);"> c</span><span class=3D"pun" style=3D"=
font-style: inherit; font-variant: inherit; font-weight: inherit; font-stre=
tch: inherit; font-size: inherit; line-height: inherit; font-family: inheri=
t; vertical-align: baseline; color: rgb(48, 51, 54);">;</span><span class=
=3D"pln" style=3D"font-style: inherit; font-variant: inherit; font-weight: =
inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; f=
ont-family: inherit; vertical-align: baseline; color: rgb(48, 51, 54);">
</span><span class=3D"pun" style=3D"font-style: inherit; font-variant: inhe=
rit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-=
height: inherit; font-family: inherit; vertical-align: baseline; color: rgb=
(48, 51, 54);">};</span></code></pre></div><div><br></div>This code snippet=
 comes from Scott Meyers&#39; &quot;Effective C++&quot; and is still the cu=
rrent one of the &quot;best&quot; solutions.<br>The other being simply to c=
opy paste the method and changing the cv qualifier.</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/5a99fc6b-316a-4958-a240-9304663aa6af%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5a99fc6b-316a-4958-a240-9304663aa6af=
%40isocpp.org</a>.<br />

------=_Part_3877_1959003995.1510477043975--

------=_Part_3876_105878913.1510477043974--

.