Topic: Named base classes
Author: tmlen <timlenertz@gmail.com>
Date: Mon, 12 Dec 2016 12:01:58 -0800 (PST)
Raw View
------=_Part_1539_1580599876.1481572918628
Content-Type: multipart/alternative;
boundary="----=_Part_1540_559999794.1481572918629"
------=_Part_1540_559999794.1481572918629
Content-Type: text/plain; charset=UTF-8
In a code like
template<typename Value, std::size_t I, std::size_J, typename Allocator>
class A {
public:
A();
A(std::size_t w, std::size_t h);
A(const A&);
void f();
};
template<typename Value, std::size_t I, std::size_t J, typename Allocator>
class B : public A<Value, I, J, Allocator> {
public:
using A<Value, I, J, Allocator>::A;
void f() {
A<Value, I, J, Allocator>::f();
...
}
};
It is necessary to use
A<Value, I, J, Allocator>::
every time a member of the base class A is accessed from the derived class
B, because the base is a dependent name. Because this can become too
verbose, a solution is to define a typedef or the base class like
template<typename Value, std::size_t I, std::size_t J, typename Allocator>
class B : public A<Value, I, J, Allocator> {
using base = A<Value, I, J, Allocator>;
public:
using base::base;
void f() {
base::f();
...
}
};
But then it is still necessary to duplicate the name of the base class.
It may be useful to have a way to define such a typedef without having to
repeat the full name of the base class, such as for example
template<typename Value, std::size_t I, std::size_t J, typename Allocator>
class B : public A<Value, I, J, Allocator> base {
public:
using base::base;
void f() {
base::f();
...
}
};
which would define a `base` as a private type member in B.
--
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/f869322f-4933-440c-a27c-b9687534356b%40isocpp.org.
------=_Part_1540_559999794.1481572918629
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">In a code like<div><br></div><div class=3D"prettyprint" st=
yle=3D"background-color: rgb(250, 250, 250); border: 1px solid rgb(187, 187=
, 187); word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"s=
ubprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">te=
mplate</span><span style=3D"color: #660;" class=3D"styled-by-prettify"><=
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">typename</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #606;" class=3D"styled-by-prettify">Value</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> std</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">size_t I</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
>size_J</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">typename</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #606;" class=3D"styled-by-prettify">Allocator</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">></span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;"=
class=3D"styled-by-prettify">class</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> A </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></span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">public</span><span style=3D"color: #660;" class=3D"styled-by-prettify">:=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0=
=C2=A0 A</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(=
);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 A</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">std</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify">size_t w</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> std</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">size_t h</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 A</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">const</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> A</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">&);</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br><br></span><span style=3D"color: rgb(0, 0, 0);"><span style=3D"color:=
#000;" class=3D"styled-by-prettify">=C2=A0 =C2=A0 </span></span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">void</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> f</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">();</span><span style=3D"color: #000;" cl=
ass=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></span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">template</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify"><</span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">typename</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Value</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify"> std</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">size_t I</span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">size_t J</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">type=
name</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #606;" class=3D"styled-by-prettify">Allocator</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: #008;" class=3D"styled-by-prettify">class</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> B </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: #008;" class=3D"sty=
led-by-prettify">public</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> A</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify"><</span><span style=3D"color: #606;" class=3D"styled-by-prettify">V=
alue</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> I</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> J</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: #606;" class=3D"sty=
led-by-prettify">Allocator</span><span style=3D"color: #660;" class=3D"styl=
ed-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"><br></sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">public</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"c=
olor: rgb(0, 0, 0);"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">=C2=A0 =C2=A0 </span></span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">using</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> A</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
"><</span><span style=3D"color: #606;" class=3D"styled-by-prettify">Valu=
e</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> I</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> J</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"style=
d-by-prettify">Allocator</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">>::</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">A</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=
</span><span style=3D"color: rgb(0, 0, 0);"><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">=C2=A0 =C2=A0 </span></span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">void</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"styl=
ed-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r>=C2=A0 =C2=A0 A</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify"><</span><span style=3D"color: #606;" class=3D"styled-by-prettify"=
>Value</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> I</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> J</span><span style=3D"colo=
r: #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">Allocator</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">>::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">f</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">();</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">...</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"><br>=C2=A0 =C2=A0 </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: #660;" class=3D"styled-by-p=
rettify">};</span></div></code></div><div><br><br></div><div>It is necessar=
y to use =C2=A0<div class=3D"prettyprint" style=3D"background-color: rgb(25=
0, 250, 250); border: 1px solid rgb(187, 187, 187); word-wrap: break-word;"=
><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify">A</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify"><</span><span style=3D"color: #606;" cl=
ass=3D"styled-by-prettify">Value</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> I</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> J=
</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: #606;" class=3D"styled-by-prettify">Allocator</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">>::</span></div></code></=
div>every time a member of the base class A is accessed from the derived cl=
ass B, because the base is a dependent name. Because this can become too ve=
rbose, a solution is to define a typedef or the base class like</div><div><=
br></div><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250=
, 250); border: 1px solid rgb(187, 187, 187); word-wrap: break-word;"><code=
class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: =
#008;" class=3D"styled-by-prettify">template</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify"><</span><span style=3D"color: #008;" c=
lass=3D"styled-by-prettify">typename</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"sty=
led-by-prettify">Value</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> std</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</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify"> std</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">size_t J</span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">typename</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-pr=
ettify">Allocator</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">></span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">class=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> B </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">public</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> A</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify"><</span><span style=3D"color: #606;" class=
=3D"styled-by-prettify">Value</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> I</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> J</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #606;" class=3D"styled-by-prettify">Allocator</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">></span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">using</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">base</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> A</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify"><</span><span sty=
le=3D"color: #606;" class=3D"styled-by-prettify">Value</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> I</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> J</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">Allocato=
r</span><span style=3D"color: #660;" class=3D"styled-by-prettify">>;</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">public</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0</span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">using</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">base</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">::</span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">base</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br><br>=C2=A0 =C2=A0</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"st=
yled-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=
"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=
=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>base</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</s=
pan><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"><br>=C2=A0 =C2=A0 =C2=A0 </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">...</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0</s=
pan><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"colo=
r: #000;" class=3D"styled-by-prettify"><br><br></span></div></code></div><d=
iv><br>But then it is still necessary to duplicate the name of the base cla=
ss.</div><div><br></div><div>It may be useful to have a way to define such =
a typedef without having to repeat the full name of the base class, such as=
for example</div><div><br></div><div><div class=3D"prettyprint" style=3D"b=
ackground-color: rgb(250, 250, 250); border: 1px solid rgb(187, 187, 187); =
word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpretty=
print"><span style=3D"color: #008;" class=3D"styled-by-prettify">template</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify"><</span><=
span style=3D"color: #008;" class=3D"styled-by-prettify">typename</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #606;" class=3D"styled-by-prettify">Value</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">size_t I</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> std</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">size_t=
J</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">typename</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #606;" class=3D"styled-by-prettify">Allocator</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: #008;" clas=
s=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> B </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: #008;" class=3D"styled-by-prettify">publi=
c</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> A</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify"><</span><span =
style=3D"color: #606;" class=3D"styled-by-prettify">Value</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> I</span><span style=3D"color: #660;"=
class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> J</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: #606;" class=3D"styled-by-prettify">Alloc=
ator</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">base</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">public</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">using</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">base</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::=
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">base</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br><br><br>=C2=A0 =C2=A0=
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">void</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">base</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">f</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">();</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">...</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">};</span></div></code></div><div><br></div></div><div>which would=
define a `base` as a private type member in B.</div><div><br></div><div><b=
r></div><div><br></div><div><br></div><div><br></div><div><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/f869322f-4933-440c-a27c-b9687534356b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f869322f-4933-440c-a27c-b9687534356b=
%40isocpp.org</a>.<br />
------=_Part_1540_559999794.1481572918629--
------=_Part_1539_1580599876.1481572918628--
.
Author: Chris DeVisser <chris.n.devisser@gmail.com>
Date: Mon, 12 Dec 2016 15:47:06 -0500
Raw View
--001a114d32422ad4cb05437c3678
Content-Type: text/plain; charset=UTF-8
I would go so far as to say that you shouldn't need template arguments in
the case of having a single instantiation of that template as a base class
(just like you don't need template arguments within a template's own
class). I'm not sure to what extent that has been discussed or what kind of
gotchas there are with that.
Regarding naming individual base classes, I might suggest an alias sort of
syntax. Unfortunately, `class B : public A<...> typedef base` looks great
except for the typedef part, which the language has been trying to move
away from. Putting a using in there could cause confusion with the operator
dot proposal.
On Mon, Dec 12, 2016 at 3:01 PM, tmlen <timlenertz@gmail.com> wrote:
> In a code like
>
> template<typename Value, std::size_t I, std::size_J, typename Allocator>
> class A {
> public:
> A();
> A(std::size_t w, std::size_t h);
> A(const A&);
>
> void f();
> };
>
> template<typename Value, std::size_t I, std::size_t J, typename Allocator>
> class B : public A<Value, I, J, Allocator> {
> public:
> using A<Value, I, J, Allocator>::A;
>
> void f() {
> A<Value, I, J, Allocator>::f();
> ...
> }
> };
>
>
> It is necessary to use
> A<Value, I, J, Allocator>::
> every time a member of the base class A is accessed from the derived class
> B, because the base is a dependent name. Because this can become too
> verbose, a solution is to define a typedef or the base class like
>
> template<typename Value, std::size_t I, std::size_t J, typename Allocator>
> class B : public A<Value, I, J, Allocator> {
> using base = A<Value, I, J, Allocator>;
>
> public:
> using base::base;
>
> void f() {
> base::f();
> ...
> }
> };
>
>
> But then it is still necessary to duplicate the name of the base class.
>
> It may be useful to have a way to define such a typedef without having to
> repeat the full name of the base class, such as for example
>
> template<typename Value, std::size_t I, std::size_t J, typename Allocator>
> class B : public A<Value, I, J, Allocator> base {
> public:
> using base::base;
>
>
> void f() {
> base::f();
> ...
> }
> };
>
> which would define a `base` as a private type member in B.
>
>
>
>
>
>
> --
> 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/f869322f-4933-440c-
> a27c-b9687534356b%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/f869322f-4933-440c-a27c-b9687534356b%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAM6NJy6K9ZMxH7muD6c3dq%3DCsX3tkUcpbbsZq6WGVA2Zawi4Kg%40mail.gmail.com.
--001a114d32422ad4cb05437c3678
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I would go so far as to say that you shouldn't need te=
mplate arguments in the case of having a single instantiation of that templ=
ate as a base class (just like you don't need template arguments within=
a template's own class). I'm not sure to what extent that has been=
discussed or what kind of gotchas there are with that.<div><br></div><div>=
Regarding naming individual base classes, I might suggest an alias sort of =
syntax. Unfortunately, `class B : public A<...> typedef base` looks g=
reat except for the typedef part, which the language has been trying to mov=
e away from. Putting a using in there could cause confusion with the operat=
or dot proposal.</div></div><div class=3D"gmail_extra"><br><div class=3D"gm=
ail_quote">On Mon, Dec 12, 2016 at 3:01 PM, tmlen <span dir=3D"ltr"><<a =
href=3D"mailto:timlenertz@gmail.com" target=3D"_blank">timlenertz@gmail.com=
</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">I=
n a code like<div><br></div><div class=3D"m_-8083974941141415443prettyprint=
" style=3D"background-color:rgb(250,250,250);border:1px solid rgb(187,187,1=
87);word-wrap:break-word"><code class=3D"m_-8083974941141415443prettyprint"=
><div class=3D"m_-8083974941141415443subprettyprint"><span style=3D"color:#=
008" class=3D"m_-8083974941141415443styled-by-prettify">template</span><spa=
n style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">&=
lt;</span><span style=3D"color:#008" class=3D"m_-8083974941141415443styled-=
by-prettify">typename</span><span style=3D"color:#000" class=3D"m_-80839749=
41141415443styled-by-prettify"> </span><span style=3D"color:#606" class=3D"=
m_-8083974941141415443styled-by-prettify">Value</span><span style=3D"color:=
#660" class=3D"m_-8083974941141415443styled-by-prettify">,</span><span styl=
e=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> std</s=
pan><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-pre=
ttify">::</span><span style=3D"color:#000" class=3D"m_-8083974941141415443s=
tyled-by-prettify">size_t I</span><span style=3D"color:#660" class=3D"m_-80=
83974941141415443styled-by-prettify">,</span><span style=3D"color:#000" cla=
ss=3D"m_-8083974941141415443styled-by-prettify"> std</span><span style=3D"c=
olor:#660" class=3D"m_-8083974941141415443styled-by-prettify">::</span><spa=
n style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify">s=
ize_J</span><span style=3D"color:#660" class=3D"m_-8083974941141415443style=
d-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-8083974941141=
415443styled-by-prettify"> </span><span style=3D"color:#008" class=3D"m_-80=
83974941141415443styled-by-prettify">typename</span><span style=3D"color:#0=
00" class=3D"m_-8083974941141415443styled-by-prettify"> </span><span style=
=3D"color:#606" class=3D"m_-8083974941141415443styled-by-prettify">Allocato=
r</span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by=
-prettify">></span><span style=3D"color:#000" class=3D"m_-80839749411414=
15443styled-by-prettify"><br></span><span style=3D"color:#008" class=3D"m_-=
8083974941141415443styled-by-prettify">class</span><span style=3D"color:#00=
0" class=3D"m_-8083974941141415443styled-by-prettify"> A </span><span style=
=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">{</span>=
<span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettif=
y"><br></span><span style=3D"color:#008" class=3D"m_-8083974941141415443sty=
led-by-prettify">public</span><span style=3D"color:#660" class=3D"m_-808397=
4941141415443styled-by-prettify">:</span><span style=3D"color:#000" class=
=3D"m_-8083974941141415443styled-by-prettify"><br>=C2=A0 =C2=A0 A</span><sp=
an style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">=
();</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-=
by-prettify"><br>=C2=A0 =C2=A0 A</span><span style=3D"color:#660" class=3D"=
m_-8083974941141415443styled-by-prettify">(</span><span style=3D"color:#000=
" class=3D"m_-8083974941141415443styled-by-prettify">std</span><span style=
=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">::</span=
><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-pretti=
fy">size_t w</span><span style=3D"color:#660" class=3D"m_-80839749411414154=
43styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-808397=
4941141415443styled-by-prettify"> std</span><span style=3D"color:#660" clas=
s=3D"m_-8083974941141415443styled-by-prettify">::</span><span style=3D"colo=
r:#000" class=3D"m_-8083974941141415443styled-by-prettify">size_t h</span><=
span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify=
">);</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled=
-by-prettify"><br>=C2=A0 =C2=A0 A</span><span style=3D"color:#660" class=3D=
"m_-8083974941141415443styled-by-prettify">(</span><span style=3D"color:#00=
8" class=3D"m_-8083974941141415443styled-by-prettify">const</span><span sty=
le=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> A</sp=
an><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-pret=
tify">&);</span><span style=3D"color:#000" class=3D"m_-8083974941141415=
443styled-by-prettify"><br><br></span><span style=3D"color:rgb(0,0,0)"><spa=
n style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify">=
=C2=A0 =C2=A0 </span></span><span style=3D"color:#008" class=3D"m_-80839749=
41141415443styled-by-prettify">void</span><span style=3D"color:#000" class=
=3D"m_-8083974941141415443styled-by-prettify"> f</span><span style=3D"color=
:#660" class=3D"m_-8083974941141415443styled-by-prettify">();</span><span s=
tyle=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"><br>=
</span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-=
prettify">};</span><span style=3D"color:#000" class=3D"m_-80839749411414154=
43styled-by-prettify"><br><br></span><span style=3D"color:#008" class=3D"m_=
-8083974941141415443styled-by-prettify">template</span><span style=3D"color=
:#660" class=3D"m_-8083974941141415443styled-by-prettify"><</span><span =
style=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify">typ=
ename</span><span style=3D"color:#000" class=3D"m_-8083974941141415443style=
d-by-prettify"> </span><span style=3D"color:#606" class=3D"m_-8083974941141=
415443styled-by-prettify">Value</span><span style=3D"color:#660" class=3D"m=
_-8083974941141415443styled-by-prettify">,</span><span style=3D"color:#000"=
class=3D"m_-8083974941141415443styled-by-prettify"> std</span><span style=
=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">::</span=
><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-pretti=
fy">size_t I</span><span style=3D"color:#660" class=3D"m_-80839749411414154=
43styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-808397=
4941141415443styled-by-prettify"> std</span><span style=3D"color:#660" clas=
s=3D"m_-8083974941141415443styled-by-prettify">::</span><span style=3D"colo=
r:#000" class=3D"m_-8083974941141415443styled-by-prettify">size_t J</span><=
span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify=
">,</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-=
by-prettify"> </span><span style=3D"color:#008" class=3D"m_-808397494114141=
5443styled-by-prettify">typename</span><span style=3D"color:#000" class=3D"=
m_-8083974941141415443styled-by-prettify"> </span><span style=3D"color:#606=
" class=3D"m_-8083974941141415443styled-by-prettify">Allocator</span><span =
style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">>=
;</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by=
-prettify"><br></span><span style=3D"color:#008" class=3D"m_-80839749411414=
15443styled-by-prettify">class</span><span style=3D"color:#000" class=3D"m_=
-8083974941141415443styled-by-prettify"> B </span><span style=3D"color:#660=
" class=3D"m_-8083974941141415443styled-by-prettify">:</span><span style=3D=
"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> </span><sp=
an style=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify">=
public</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styl=
ed-by-prettify"> A</span><span style=3D"color:#660" class=3D"m_-80839749411=
41415443styled-by-prettify"><</span><span style=3D"color:#606" class=3D"=
m_-8083974941141415443styled-by-prettify">Value</span><span style=3D"color:=
#660" class=3D"m_-8083974941141415443styled-by-prettify">,</span><span styl=
e=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> I</spa=
n><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prett=
ify">,</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styl=
ed-by-prettify"> J</span><span style=3D"color:#660" class=3D"m_-80839749411=
41415443styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-=
8083974941141415443styled-by-prettify"> </span><span style=3D"color:#606" c=
lass=3D"m_-8083974941141415443styled-by-prettify">Allocator</span><span sty=
le=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">></=
span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-pr=
ettify"> </span><span style=3D"color:#660" class=3D"m_-8083974941141415443s=
tyled-by-prettify">{</span><span style=3D"color:#000" class=3D"m_-808397494=
1141415443styled-by-prettify"><br></span><span style=3D"color:#008" class=
=3D"m_-8083974941141415443styled-by-prettify">public</span><span style=3D"c=
olor:#660" class=3D"m_-8083974941141415443styled-by-prettify">:</span><span=
style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"><b=
r></span><span style=3D"color:rgb(0,0,0)"><span style=3D"color:#000" class=
=3D"m_-8083974941141415443styled-by-prettify">=C2=A0 =C2=A0 </span></span><=
span style=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify=
">using</span><span style=3D"color:#000" class=3D"m_-8083974941141415443sty=
led-by-prettify"> A</span><span style=3D"color:#660" class=3D"m_-8083974941=
141415443styled-by-prettify"><</span><span style=3D"color:#606" class=3D=
"m_-8083974941141415443styled-by-prettify">Value</span><span style=3D"color=
:#660" class=3D"m_-8083974941141415443styled-by-prettify">,</span><span sty=
le=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> I</sp=
an><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-pret=
tify">,</span><span style=3D"color:#000" class=3D"m_-8083974941141415443sty=
led-by-prettify"> J</span><span style=3D"color:#660" class=3D"m_-8083974941=
141415443styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_=
-8083974941141415443styled-by-prettify"> </span><span style=3D"color:#606" =
class=3D"m_-8083974941141415443styled-by-prettify">Allocator</span><span st=
yle=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">>:=
:</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by=
-prettify">A</span><span style=3D"color:#660" class=3D"m_-80839749411414154=
43styled-by-prettify">;</span><span style=3D"color:#000" class=3D"m_-808397=
4941141415443styled-by-prettify"><br><br></span><span style=3D"color:rgb(0,=
0,0)"><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-p=
rettify">=C2=A0 =C2=A0 </span></span><span style=3D"color:#008" class=3D"m_=
-8083974941141415443styled-by-prettify">void</span><span style=3D"color:#00=
0" class=3D"m_-8083974941141415443styled-by-prettify"> f</span><span style=
=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">()</span=
><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-pretti=
fy"> </span><span style=3D"color:#660" class=3D"m_-8083974941141415443style=
d-by-prettify">{</span><span style=3D"color:#000" class=3D"m_-8083974941141=
415443styled-by-prettify"><br>=C2=A0 =C2=A0 A</span><span style=3D"color:#6=
60" class=3D"m_-8083974941141415443styled-by-prettify"><</span><span sty=
le=3D"color:#606" class=3D"m_-8083974941141415443styled-by-prettify">Value<=
/span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-p=
rettify">,</span><span style=3D"color:#000" class=3D"m_-8083974941141415443=
styled-by-prettify"> I</span><span style=3D"color:#660" class=3D"m_-8083974=
941141415443styled-by-prettify">,</span><span style=3D"color:#000" class=3D=
"m_-8083974941141415443styled-by-prettify"> J</span><span style=3D"color:#6=
60" class=3D"m_-8083974941141415443styled-by-prettify">,</span><span style=
=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> </span>=
<span style=3D"color:#606" class=3D"m_-8083974941141415443styled-by-prettif=
y">Allocator</span><span style=3D"color:#660" class=3D"m_-80839749411414154=
43styled-by-prettify">>::</span><span style=3D"color:#000" class=3D"m_-8=
083974941141415443styled-by-prettify">f</span><span style=3D"color:#660" cl=
ass=3D"m_-8083974941141415443styled-by-prettify">();</span><span style=3D"c=
olor:#000" class=3D"m_-8083974941141415443styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0</span><span style=3D"color:#660" class=3D"m_-808397494=
1141415443styled-by-prettify">...</span><span style=3D"color:#000" class=3D=
"m_-8083974941141415443styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span s=
tyle=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">}</s=
pan><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-pre=
ttify"><br></span><span style=3D"color:#660" class=3D"m_-808397494114141544=
3styled-by-prettify">};</span></div></code></div><div><br><br></div><div>It=
is necessary to use =C2=A0<div class=3D"m_-8083974941141415443prettyprint"=
style=3D"background-color:rgb(250,250,250);border:1px solid rgb(187,187,18=
7);word-wrap:break-word"><code class=3D"m_-8083974941141415443prettyprint">=
<div class=3D"m_-8083974941141415443subprettyprint"><span style=3D"color:#0=
00" class=3D"m_-8083974941141415443styled-by-prettify">A</span><span style=
=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify"><</sp=
an><span style=3D"color:#606" class=3D"m_-8083974941141415443styled-by-pret=
tify">Value</span><span style=3D"color:#660" class=3D"m_-808397494114141544=
3styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-8083974=
941141415443styled-by-prettify"> I</span><span style=3D"color:#660" class=
=3D"m_-8083974941141415443styled-by-prettify">,</span><span style=3D"color:=
#000" class=3D"m_-8083974941141415443styled-by-prettify"> J</span><span sty=
le=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">,</spa=
n><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prett=
ify"> </span><span style=3D"color:#606" class=3D"m_-8083974941141415443styl=
ed-by-prettify">Allocator</span><span style=3D"color:#660" class=3D"m_-8083=
974941141415443styled-by-prettify">>::</span></div></code></div>every ti=
me a member of the base class A is accessed from the derived class B, becau=
se the base is a dependent name. Because this can become too verbose, a sol=
ution is to define a typedef or the base class like</div><div><br></div><di=
v class=3D"m_-8083974941141415443prettyprint" style=3D"background-color:rgb=
(250,250,250);border:1px solid rgb(187,187,187);word-wrap:break-word"><code=
class=3D"m_-8083974941141415443prettyprint"><div class=3D"m_-8083974941141=
415443subprettyprint"><span style=3D"color:#008" class=3D"m_-80839749411414=
15443styled-by-prettify">template</span><span style=3D"color:#660" class=3D=
"m_-8083974941141415443styled-by-prettify"><</span><span style=3D"color:=
#008" class=3D"m_-8083974941141415443styled-by-prettify">typename</span><sp=
an style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify">=
</span><span style=3D"color:#606" class=3D"m_-8083974941141415443styled-by=
-prettify">Value</span><span style=3D"color:#660" class=3D"m_-8083974941141=
415443styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-80=
83974941141415443styled-by-prettify"> std</span><span style=3D"color:#660" =
class=3D"m_-8083974941141415443styled-by-prettify">::</span><span style=3D"=
color:#000" class=3D"m_-8083974941141415443styled-by-prettify">size_t I</sp=
an><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-pret=
tify">,</span><span style=3D"color:#000" class=3D"m_-8083974941141415443sty=
led-by-prettify"> std</span><span style=3D"color:#660" class=3D"m_-80839749=
41141415443styled-by-prettify">::</span><span style=3D"color:#000" class=3D=
"m_-8083974941141415443styled-by-prettify">size_t J</span><span style=3D"co=
lor:#660" class=3D"m_-8083974941141415443styled-by-prettify">,</span><span =
style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> </=
span><span style=3D"color:#008" class=3D"m_-8083974941141415443styled-by-pr=
ettify">typename</span><span style=3D"color:#000" class=3D"m_-8083974941141=
415443styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_-80=
83974941141415443styled-by-prettify">Allocator</span><span style=3D"color:#=
660" class=3D"m_-8083974941141415443styled-by-prettify">></span><span st=
yle=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"><br><=
/span><span style=3D"color:#008" class=3D"m_-8083974941141415443styled-by-p=
rettify">class</span><span style=3D"color:#000" class=3D"m_-808397494114141=
5443styled-by-prettify"> B </span><span style=3D"color:#660" class=3D"m_-80=
83974941141415443styled-by-prettify">:</span><span style=3D"color:#000" cla=
ss=3D"m_-8083974941141415443styled-by-prettify"> </span><span style=3D"colo=
r:#008" class=3D"m_-8083974941141415443styled-by-prettify">public</span><sp=
an style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify">=
A</span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-b=
y-prettify"><</span><span style=3D"color:#606" class=3D"m_-8083974941141=
415443styled-by-prettify">Value</span><span style=3D"color:#660" class=3D"m=
_-8083974941141415443styled-by-prettify">,</span><span style=3D"color:#000"=
class=3D"m_-8083974941141415443styled-by-prettify"> I</span><span style=3D=
"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">,</span><sp=
an style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify">=
J</span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-b=
y-prettify">,</span><span style=3D"color:#000" class=3D"m_-8083974941141415=
443styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_-80839=
74941141415443styled-by-prettify">Allocator</span><span style=3D"color:#660=
" class=3D"m_-8083974941141415443styled-by-prettify">></span><span style=
=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> </span>=
<span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettif=
y">{</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled=
-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"color:#008" class=3D"m=
_-8083974941141415443styled-by-prettify">using</span><span style=3D"color:#=
000" class=3D"m_-8083974941141415443styled-by-prettify"> </span><span style=
=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify">base</sp=
an><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-pret=
tify"> </span><span style=3D"color:#660" class=3D"m_-8083974941141415443sty=
led-by-prettify">=3D</span><span style=3D"color:#000" class=3D"m_-808397494=
1141415443styled-by-prettify"> A</span><span style=3D"color:#660" class=3D"=
m_-8083974941141415443styled-by-prettify"><</span><span style=3D"color:#=
606" class=3D"m_-8083974941141415443styled-by-prettify">Value</span><span s=
tyle=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">,</s=
pan><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-pre=
ttify"> I</span><span style=3D"color:#660" class=3D"m_-8083974941141415443s=
tyled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-808397494=
1141415443styled-by-prettify"> J</span><span style=3D"color:#660" class=3D"=
m_-8083974941141415443styled-by-prettify">,</span><span style=3D"color:#000=
" class=3D"m_-8083974941141415443styled-by-prettify"> </span><span style=3D=
"color:#606" class=3D"m_-8083974941141415443styled-by-prettify">Allocator</=
span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-pr=
ettify">>;</span><span style=3D"color:#000" class=3D"m_-8083974941141415=
443styled-by-prettify"><br><br></span><span style=3D"color:#008" class=3D"m=
_-8083974941141415443styled-by-prettify">public</span><span style=3D"color:=
#660" class=3D"m_-8083974941141415443styled-by-prettify">:</span><span styl=
e=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"><br>=C2=
=A0 =C2=A0</span><span style=3D"color:#008" class=3D"m_-8083974941141415443=
styled-by-prettify">using</span><span style=3D"color:#000" class=3D"m_-8083=
974941141415443styled-by-prettify"> </span><span style=3D"color:#008" class=
=3D"m_-8083974941141415443styled-by-prettify">base</span><span style=3D"col=
or:#660" class=3D"m_-8083974941141415443styled-by-prettify">::</span><span =
style=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify">bas=
e</span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by=
-prettify">;</span><span style=3D"color:#000" class=3D"m_-80839749411414154=
43styled-by-prettify"><br><br>=C2=A0 =C2=A0</span><span style=3D"color:#008=
" class=3D"m_-8083974941141415443styled-by-prettify">void</span><span style=
=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> f</span=
><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-pretti=
fy">()</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styl=
ed-by-prettify"> </span><span style=3D"color:#660" class=3D"m_-808397494114=
1415443styled-by-prettify">{</span><span style=3D"color:#000" class=3D"m_-8=
083974941141415443styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span=
style=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify">ba=
se</span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-b=
y-prettify">::</span><span style=3D"color:#000" class=3D"m_-808397494114141=
5443styled-by-prettify">f</span><span style=3D"color:#660" class=3D"m_-8083=
974941141415443styled-by-prettify">();</span><span style=3D"color:#000" cla=
ss=3D"m_-8083974941141415443styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 </=
span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-pr=
ettify">...</span><span style=3D"color:#000" class=3D"m_-808397494114141544=
3styled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"color:#660" cla=
ss=3D"m_-8083974941141415443styled-by-prettify">}</span><span style=3D"colo=
r:#000" class=3D"m_-8083974941141415443styled-by-prettify"><br></span><span=
style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">};=
</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-=
prettify"><br><br></span></div></code></div><div><br>But then it is still n=
ecessary to duplicate the name of the base class.</div><div><br></div><div>=
It may be useful to have a way to define such a typedef without having to r=
epeat the full name of the base class, such as for example</div><div><br></=
div><div><div class=3D"m_-8083974941141415443prettyprint" style=3D"backgrou=
nd-color:rgb(250,250,250);border:1px solid rgb(187,187,187);word-wrap:break=
-word"><code class=3D"m_-8083974941141415443prettyprint"><div class=3D"m_-8=
083974941141415443subprettyprint"><span style=3D"color:#008" class=3D"m_-80=
83974941141415443styled-by-prettify">template</span><span style=3D"color:#6=
60" class=3D"m_-8083974941141415443styled-by-prettify"><</span><span sty=
le=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify">typena=
me</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-b=
y-prettify"> </span><span style=3D"color:#606" class=3D"m_-8083974941141415=
443styled-by-prettify">Value</span><span style=3D"color:#660" class=3D"m_-8=
083974941141415443styled-by-prettify">,</span><span style=3D"color:#000" cl=
ass=3D"m_-8083974941141415443styled-by-prettify"> std</span><span style=3D"=
color:#660" class=3D"m_-8083974941141415443styled-by-prettify">::</span><sp=
an style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify">=
size_t I</span><span style=3D"color:#660" class=3D"m_-8083974941141415443st=
yled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-8083974941=
141415443styled-by-prettify"> std</span><span style=3D"color:#660" class=3D=
"m_-8083974941141415443styled-by-prettify">::</span><span style=3D"color:#0=
00" class=3D"m_-8083974941141415443styled-by-prettify">size_t J</span><span=
style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">,<=
/span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-p=
rettify"> </span><span style=3D"color:#008" class=3D"m_-8083974941141415443=
styled-by-prettify">typename</span><span style=3D"color:#000" class=3D"m_-8=
083974941141415443styled-by-prettify"> </span><span style=3D"color:#606" cl=
ass=3D"m_-8083974941141415443styled-by-prettify">Allocator</span><span styl=
e=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">></s=
pan><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-pre=
ttify"><br></span><span style=3D"color:#008" class=3D"m_-808397494114141544=
3styled-by-prettify">class</span><span style=3D"color:#000" class=3D"m_-808=
3974941141415443styled-by-prettify"> B </span><span style=3D"color:#660" cl=
ass=3D"m_-8083974941141415443styled-by-prettify">:</span><span style=3D"col=
or:#000" class=3D"m_-8083974941141415443styled-by-prettify"> </span><span s=
tyle=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify">publ=
ic</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-b=
y-prettify"> A</span><span style=3D"color:#660" class=3D"m_-808397494114141=
5443styled-by-prettify"><</span><span style=3D"color:#606" class=3D"m_-8=
083974941141415443styled-by-prettify">Value</span><span style=3D"color:#660=
" class=3D"m_-8083974941141415443styled-by-prettify">,</span><span style=3D=
"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"> I</span><s=
pan style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify"=
>,</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-b=
y-prettify"> J</span><span style=3D"color:#660" class=3D"m_-808397494114141=
5443styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-8083=
974941141415443styled-by-prettify"> </span><span style=3D"color:#606" class=
=3D"m_-8083974941141415443styled-by-prettify">Allocator</span><span style=
=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">></sp=
an><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-pret=
tify"> </span><span style=3D"color:#008" class=3D"m_-8083974941141415443sty=
led-by-prettify">base</span><span style=3D"color:#000" class=3D"m_-80839749=
41141415443styled-by-prettify"> </span><span style=3D"color:#660" class=3D"=
m_-8083974941141415443styled-by-prettify">{</span><span style=3D"color:#000=
" class=3D"m_-8083974941141415443styled-by-prettify"><br></span><span style=
=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify">public</=
span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-pr=
ettify">:</span><span style=3D"color:#000" class=3D"m_-8083974941141415443s=
tyled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"color:#008" class=
=3D"m_-8083974941141415443styled-by-prettify">using</span><span style=3D"co=
lor:#000" class=3D"m_-8083974941141415443styled-by-prettify"> </span><span =
style=3D"color:#008" class=3D"m_-8083974941141415443styled-by-prettify">bas=
e</span><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by=
-prettify">::</span><span style=3D"color:#008" class=3D"m_-8083974941141415=
443styled-by-prettify">base</span><span style=3D"color:#660" class=3D"m_-80=
83974941141415443styled-by-prettify">;</span><span style=3D"color:#000" cla=
ss=3D"m_-8083974941141415443styled-by-prettify"><br><br><br>=C2=A0 =C2=A0</=
span><span style=3D"color:#008" class=3D"m_-8083974941141415443styled-by-pr=
ettify">void</span><span style=3D"color:#000" class=3D"m_-80839749411414154=
43styled-by-prettify"> f</span><span style=3D"color:#660" class=3D"m_-80839=
74941141415443styled-by-prettify">()</span><span style=3D"color:#000" class=
=3D"m_-8083974941141415443styled-by-prettify"> </span><span style=3D"color:=
#660" class=3D"m_-8083974941141415443styled-by-prettify">{</span><span styl=
e=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prettify"><br>=C2=
=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#008" class=3D"m_-80839749411=
41415443styled-by-prettify">base</span><span style=3D"color:#660" class=3D"=
m_-8083974941141415443styled-by-prettify">::</span><span style=3D"color:#00=
0" class=3D"m_-8083974941141415443styled-by-prettify">f</span><span style=
=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prettify">();</spa=
n><span style=3D"color:#000" class=3D"m_-8083974941141415443styled-by-prett=
ify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#660" class=3D"m_=
-8083974941141415443styled-by-prettify">...</span><span style=3D"color:#000=
" class=3D"m_-8083974941141415443styled-by-prettify"><br>=C2=A0 =C2=A0</spa=
n><span style=3D"color:#660" class=3D"m_-8083974941141415443styled-by-prett=
ify">}</span><span style=3D"color:#000" class=3D"m_-8083974941141415443styl=
ed-by-prettify"><br></span><span style=3D"color:#660" class=3D"m_-808397494=
1141415443styled-by-prettify">};</span></div></code></div><div><br></div></=
div><div>which would define a `base` as a private type member in B.</div><s=
pan class=3D"HOEnZb"><font color=3D"#888888"><div><br></div><div><br></div>=
<div><br></div><div><br></div><div><br></div><div><br></div></font></span><=
/div><span class=3D"HOEnZb"><font color=3D"#888888">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/f869322f-4933-440c-a27c-b9687534356b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/f869=
322f-4933-440c-<wbr>a27c-b9687534356b%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CAM6NJy6K9ZMxH7muD6c3dq%3DCsX3tkUcpbb=
sZq6WGVA2Zawi4Kg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAM6NJy6K9ZMxH7=
muD6c3dq%3DCsX3tkUcpbbsZq6WGVA2Zawi4Kg%40mail.gmail.com</a>.<br />
--001a114d32422ad4cb05437c3678--
.
Author: "D. B." <db0451@gmail.com>
Date: Mon, 12 Dec 2016 21:50:43 +0000
Raw View
--001a1130cf0676945005437d18cf
Content-Type: text/plain; charset=UTF-8
This seems to be little known. But in fact, what you claimed is necessary
is not, and the base typename can be used withotu having to repeat the
arguments by fully qualifying it via the derived typename:
#include <cstddef>
template<typename Value, std::size_t I, std::size_t, typename Allocator>
class A {
public:
void f() {}
};
template<typename Value, std::size_t I, std::size_t J, typename Allocator>
class B : public A<Value, I, J, Allocator> {
public:
using A<Value, I, J, Allocator>::A;
void f() {
B::A::f();
}
};
int main()
{
B<bool, 42, 13, double> b;
}
--
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/CACGiwhFkHWU2OqS82H4qoVRXahtM3EbCdqgGMcJFBUi%2B911eSg%40mail.gmail.com.
--001a1130cf0676945005437d18cf
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">This seems to be little known. But in fact, what you claim=
ed is necessary is not, and the base typename can be used withotu having to=
repeat the arguments by fully qualifying it via the derived typename:<br><=
br><div style=3D"margin-left:40px"><span style=3D"font-family:monospace,mon=
ospace">#include <cstddef><br><br>template<typename Value, std::si=
ze_t I, std::size_t, typename Allocator><br>class A {<br>public:<br>=C2=
=A0=C2=A0=C2=A0 void f() {}<br>};<br><br>template<typename Value, std::s=
ize_t I, std::size_t J, typename Allocator><br>class B : public A<Val=
ue, I, J, Allocator> {<br>public:<br>=C2=A0=C2=A0=C2=A0 using A<Value=
, I, J, Allocator>::A;<br><br>=C2=A0=C2=A0=C2=A0 void f() {<br>=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 B::A::f();<br>=C2=A0=C2=A0=C2=A0 }<br>};<=
br><br>int main()<br>{<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 B<b=
ool, 42, 13, double> b;<br>}<br></span></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CACGiwhFkHWU2OqS82H4qoVRXahtM3EbCdqgG=
McJFBUi%2B911eSg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhFkHWU2Oq=
S82H4qoVRXahtM3EbCdqgGMcJFBUi%2B911eSg%40mail.gmail.com</a>.<br />
--001a1130cf0676945005437d18cf--
.
Author: "D. B." <db0451@gmail.com>
Date: Mon, 12 Dec 2016 21:54:24 +0000
Raw View
--001a114ccb68a6168705437d253f
Content-Type: text/plain; charset=UTF-8
....and to be complete, I should've written this instead in B:
using B::A::A;
but you get the idea. I too was stuck repeating the full base name, until I
lucked into stumbling over a post where the Derived::BaseNoArgs syntax was
shown.
--
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/CACGiwhFWKug%3DX_4Les3PcYgSzTqETy-ieX3Mxcpps99yr7PEHw%40mail.gmail.com.
--001a114ccb68a6168705437d253f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">...and to be complete, I should've written this instea=
d in B:<br><br><div style=3D"margin-left:40px"><span style=3D"font-family:m=
onospace,monospace">using B::A::A;</span><br><br></div>but you get the idea=
.. I too was stuck repeating the full base name, until I lucked into stumbli=
ng over a post where the Derived::BaseNoArgs syntax was shown.<br><br></div=
>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CACGiwhFWKug%3DX_4Les3PcYgSzTqETy-ieX=
3Mxcpps99yr7PEHw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhFWKug%3D=
X_4Les3PcYgSzTqETy-ieX3Mxcpps99yr7PEHw%40mail.gmail.com</a>.<br />
--001a114ccb68a6168705437d253f--
.
Author: Victor Dyachenko <victor.dyachenko@gmail.com>
Date: Tue, 13 Dec 2016 00:07:41 -0800 (PST)
Raw View
------=_Part_1334_741653739.1481616461172
Content-Type: multipart/alternative;
boundary="----=_Part_1335_331121892.1481616461173"
------=_Part_1335_331121892.1481616461173
Content-Type: text/plain; charset=UTF-8
About base class alises:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2881.html
--
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/a9cc2997-8039-4b04-abfe-42e7cf5c6149%40isocpp.org.
------=_Part_1335_331121892.1481616461173
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">About base class alises: http://www.open-std.org/jtc1/sc22=
/wg21/docs/papers/2009/n2881.html<br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/a9cc2997-8039-4b04-abfe-42e7cf5c6149%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a9cc2997-8039-4b04-abfe-42e7cf5c6149=
%40isocpp.org</a>.<br />
------=_Part_1335_331121892.1481616461173--
------=_Part_1334_741653739.1481616461172--
.
Author: "D. B." <db0451@gmail.com>
Date: Tue, 13 Dec 2016 08:35:50 +0000
Raw View
--001a114426128c502e0543861b5f
Content-Type: text/plain; charset=UTF-8
On Tue, Dec 13, 2016 at 8:07 AM, Victor Dyachenko <
victor.dyachenko@gmail.com> wrote:
> About base class alises: http://www.open-std.org/jtc1/
> sc22/wg21/docs/papers/2009/n2881.html
>
Looks like they didn't know about the Derived::Base technique either!
Like, I get that having a specific alias might be viewed as useful for
other reasons, but it seems to be that avoiding repetition of base template
args is not one of them. Rather, we should figure out how to make it known
to more people that there is already a way to avoid that.
The argument will then be about whether we want a generic way to do this,
which is a bit like the oft-requested-and-rejected "super" keyword.
However, I'd argue that Derived::Base is sufficiently succinct that neither
a typedef nor a generic keyword is necessary, and sufficiently specific
that anything less specific is not desirable. But YMMV.
--
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/CACGiwhGh3NYRkKZwaVTUobZYgax%2Bnm1CtrJx%3DVYOd8whXO6gsQ%40mail.gmail.com.
--001a114426128c502e0543861b5f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
ue, Dec 13, 2016 at 8:07 AM, Victor Dyachenko <span dir=3D"ltr"><<a href=
=3D"mailto:victor.dyachenko@gmail.com" target=3D"_blank">victor.dyachenko@g=
mail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr">About base class alises: <a href=3D"http://www.open-std.org/jtc1/s=
c22/wg21/docs/papers/2009/n2881.html" target=3D"_blank">http://www.open-std=
..org/jtc1/<wbr>sc22/wg21/docs/papers/2009/<wbr>n2881.html</a><br></div></bl=
ockquote><div><br></div><div>Looks like they didn't know about the Deri=
ved::Base technique either!<br><br></div><div>Like, I get that having a spe=
cific alias might be viewed as useful for other reasons, but it seems to be=
that avoiding repetition of base template args is not one of them. Rather,=
we should figure out how to make it known to more people that there is alr=
eady a way to avoid that.<br><br>The argument will then be about whether we=
want a generic way to do this, which is a bit like the oft-requested-and-r=
ejected "super" keyword. However, I'd argue that Derived::Bas=
e is sufficiently succinct that neither a typedef nor a generic keyword is =
necessary, and sufficiently specific that anything less specific is not des=
irable. But YMMV.<br><br></div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CACGiwhGh3NYRkKZwaVTUobZYgax%2Bnm1Ctr=
Jx%3DVYOd8whXO6gsQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhGh3NYR=
kKZwaVTUobZYgax%2Bnm1CtrJx%3DVYOd8whXO6gsQ%40mail.gmail.com</a>.<br />
--001a114426128c502e0543861b5f--
.
Author: Victor Dyachenko <victor.dyachenko@gmail.com>
Date: Tue, 13 Dec 2016 00:43:14 -0800 (PST)
Raw View
------=_Part_48_3082462.1481618594773
Content-Type: multipart/alternative;
boundary="----=_Part_49_887373177.1481618594773"
------=_Part_49_887373177.1481618594773
Content-Type: text/plain; charset=UTF-8
On Tuesday, December 13, 2016 at 12:50:45 AM UTC+3, D. B. wrote:
>
> template<typename Value, std::size_t I, std::size_t J, typename Allocator>
> class B : public A<Value, I, J, Allocator> {
> public:
> using A<Value, I, J, Allocator>::A;
>
> void f() {
> B::A::f();
> }
> };
>
It is not shorter than
using base = A<Value, I, J, Allocator>;
void f() {
base::f();
}
And you also have to write A<Value, I, J, Allocator> twice.
--
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/7c99e1b0-f111-4347-9744-0b61240135be%40isocpp.org.
------=_Part_49_887373177.1481618594773
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>On Tuesday, December 13, 2016 at 12:50:45 AM UTC+3, D.=
B. wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><sp=
an style=3D"font-family:monospace,monospace"></span><span style=3D"font-fam=
ily:monospace,monospace">template<typename Value, std::size_t I, std::si=
ze_t J, typename Allocator></span><br><span style=3D"font-family:monospa=
ce,monospace"></span><div style=3D"margin-left:40px"><span style=3D"font-fa=
mily:monospace,monospace">class B : public A<Value, I, J, Allocator> =
{<br>public:<br>=C2=A0=C2=A0=C2=A0 using A<Value, I, J, Allocator>::A=
;<br><br>=C2=A0=C2=A0=C2=A0 void f() {<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 B::A::f();<br>=C2=A0=C2=A0=C2=A0 }<br>};</span></div></div></bloc=
kquote><div><br>It is not shorter than <br><span style=3D"font-family:monos=
pace,monospace"><br></span><div style=3D"background-color: rgb(250, 250, 25=
0); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1p=
x; overflow-wrap: break-word;" class=3D"prettyprint"><code class=3D"prettyp=
rint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">using</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">base</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> A</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify"><</span><span style=3D=
"color: #606;" class=3D"styled-by-prettify">Value</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"> I</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> J</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #606;" class=3D"styled-by-prettify">Allocator</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">>;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> f</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">()</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">base</span><span style=3D"color: #660;" class=3D"st=
yled-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"><br></=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></co=
de></div><br>And you also have to write <code class=3D"prettyprint"><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify">A</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify"><</span><span style=3D"color: =
#606;" class=3D"styled-by-prettify">Value</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> I</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> J</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #606;" class=3D"styled-by-prettify">Allocator</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">><span style=3D"c=
olor: rgb(0, 0, 0);"> twice</span>.</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify"></span></code></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/7c99e1b0-f111-4347-9744-0b61240135be%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7c99e1b0-f111-4347-9744-0b61240135be=
%40isocpp.org</a>.<br />
------=_Part_49_887373177.1481618594773--
------=_Part_48_3082462.1481618594773--
.
Author: Miro Knejp <miro.knejp@gmail.com>
Date: Tue, 13 Dec 2016 01:16:47 -0800 (PST)
Raw View
------=_Part_1415_1294054634.1481620607439
Content-Type: multipart/alternative;
boundary="----=_Part_1416_700435989.1481620607439"
------=_Part_1416_700435989.1481620607439
Content-Type: text/plain; charset=UTF-8
Am Dienstag, 13. Dezember 2016 09:35:52 UTC+1 schrieb D. B.:
>
> On Tue, Dec 13, 2016 at 8:07 AM, Victor Dyachenko <victor.d...@gmail.com
> <javascript:>> wrote:
>
>> About base class alises:
>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2881.html
>>
>
> Looks like they didn't know about the Derived::Base technique either!
>
> Like, I get that having a specific alias might be viewed as useful for
> other reasons, but it seems to be that avoiding repetition of base template
> args is not one of them. Rather, we should figure out how to make it known
> to more people that there is already a way to avoid that.
>
> The argument will then be about whether we want a generic way to do this,
> which is a bit like the oft-requested-and-rejected "super" keyword.
> However, I'd argue that Derived::Base is sufficiently succinct that neither
> a typedef nor a generic keyword is necessary, and sufficiently specific
> that anything less specific is not desirable. But YMMV.
>
template<typename T>
class C : std::conditional_t<..., A, B>
{
// What's Derived::Base here?
};
--
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/bc20cc54-fd73-453a-ae17-be27adac571d%40isocpp.org.
------=_Part_1416_700435989.1481620607439
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Am Dienstag, 13. Dezember 2016 09:35:52 UTC+1 schrieb D. B=
..:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;b=
order-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><div c=
lass=3D"gmail_quote">On Tue, Dec 13, 2016 at 8:07 AM, Victor Dyachenko <spa=
n dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-=
mailto=3D"YzU-X3RpCQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'ja=
vascript:';return true;" onclick=3D"this.href=3D'javascript:';r=
eturn true;">victor.d...@gmail.com</a>></span> wrote:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr">About base class alises: <a href=3D"http:/=
/www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2881.html" target=3D"_bl=
ank" rel=3D"nofollow" onmousedown=3D"this.href=3D'http://www.google.com=
/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fdocs%2Fpaper=
s%2F2009%2Fn2881.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcI1Hm1uCD7bE=
0I5FZo_WTrn72nw';return true;" onclick=3D"this.href=3D'http://www.g=
oogle.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fdoc=
s%2Fpapers%2F2009%2Fn2881.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcI1=
Hm1uCD7bE0I5FZo_WTrn72nw';return true;">http://www.open-std.org/jtc1/<w=
br>sc22/wg21/docs/papers/2009/<wbr>n2881.html</a><br></div></blockquote><di=
v><br></div><div>Looks like they didn't know about the Derived::Base te=
chnique either!<br><br></div><div>Like, I get that having a specific alias =
might be viewed as useful for other reasons, but it seems to be that avoidi=
ng repetition of base template args is not one of them. Rather, we should f=
igure out how to make it known to more people that there is already a way t=
o avoid that.<br><br>The argument will then be about whether we want a gene=
ric way to do this, which is a bit like the oft-requested-and-rejected &quo=
t;super" keyword. However, I'd argue that Derived::Base is suffici=
ently succinct that neither a typedef nor a generic keyword is necessary, a=
nd sufficiently specific that anything less specific is not desirable. But =
YMMV.<br></div></div></div></div></blockquote><div>template<typename T&g=
t;=C2=A0</div><div>class C : std::conditional_t<..., A, B></div><div>=
{</div><div>=C2=A0 // What's Derived::Base here?</div><div>};</div></di=
v>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/bc20cc54-fd73-453a-ae17-be27adac571d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/bc20cc54-fd73-453a-ae17-be27adac571d=
%40isocpp.org</a>.<br />
------=_Part_1416_700435989.1481620607439--
------=_Part_1415_1294054634.1481620607439--
.
Author: "D. B." <db0451@gmail.com>
Date: Tue, 13 Dec 2016 10:30:58 +0000
Raw View
--001a114312ec5a81df054387b727
Content-Type: text/plain; charset=UTF-8
On Tue, Dec 13, 2016 at 8:43 AM, Victor Dyachenko <
victor.dyachenko@gmail.com> wrote:
>
> It is not shorter than
>
> using base = A<Value, I, J, Allocator>;
>
> void f() {
> base::f();
> }
>
> And you also have to write A<Value, I, J, Allocator> twice.
>
Where? Note that the inherited constructor was something I missed when
updating the OP's example.
On Tue, Dec 13, 2016 at 9:16 AM, Miro Knejp <miro.knejp@gmail.com> wrote:
> template<typename T>
> class C : std::conditional_t<..., A, B>
> {
> // What's Derived::Base here?
> };
>
Right, good point. This is an argument in favour of a generic way to do
this. Thanks!
--
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/CACGiwhHM0MDnXQV0uy7UaHCB%3DG%3D72p9Sh3dPvi44%2B2KC7JdYCw%40mail.gmail.com.
--001a114312ec5a81df054387b727
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
ue, Dec 13, 2016 at 8:43 AM, Victor Dyachenko <span dir=3D"ltr"><<a href=
=3D"mailto:victor.dyachenko@gmail.com" target=3D"_blank">victor.dyachenko@g=
mail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><div dir=3D"ltr"><div><br>It is not shorter than <br><span style=
=3D"font-family:monospace,monospace"><br></span><div style=3D"background-co=
lor:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;borde=
r-width:1px" class=3D"gmail-m_5260688284803056731prettyprint"><code class=
=3D"gmail-m_5260688284803056731prettyprint"><div class=3D"gmail-m_526068828=
4803056731subprettyprint"><span style=3D"color:rgb(0,0,136)" class=3D"gmail=
-m_5260688284803056731styled-by-prettify">using</span><span style=3D"color:=
rgb(0,0,0)" class=3D"gmail-m_5260688284803056731styled-by-prettify"> </span=
><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_5260688284803056731sty=
led-by-prettify">base</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail=
-m_5260688284803056731styled-by-prettify"> </span><span style=3D"color:rgb(=
102,102,0)" class=3D"gmail-m_5260688284803056731styled-by-prettify">=3D</sp=
an><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_5260688284803056731sty=
led-by-prettify"> A</span><span style=3D"color:rgb(102,102,0)" class=3D"gma=
il-m_5260688284803056731styled-by-prettify"><</span><span style=3D"color=
:rgb(102,0,102)" class=3D"gmail-m_5260688284803056731styled-by-prettify">Va=
lue</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_52606882848=
03056731styled-by-prettify">,</span><span style=3D"color:rgb(0,0,0)" class=
=3D"gmail-m_5260688284803056731styled-by-prettify"> I</span><span style=3D"=
color:rgb(102,102,0)" class=3D"gmail-m_5260688284803056731styled-by-prettif=
y">,</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_52606882848030=
56731styled-by-prettify"> J</span><span style=3D"color:rgb(102,102,0)" clas=
s=3D"gmail-m_5260688284803056731styled-by-prettify">,</span><span style=3D"=
color:rgb(0,0,0)" class=3D"gmail-m_5260688284803056731styled-by-prettify"> =
</span><span style=3D"color:rgb(102,0,102)" class=3D"gmail-m_52606882848030=
56731styled-by-prettify">Allocator</span><span style=3D"color:rgb(102,102,0=
)" class=3D"gmail-m_5260688284803056731styled-by-prettify">>;</span><spa=
n style=3D"color:rgb(0,0,0)" class=3D"gmail-m_5260688284803056731styled-by-=
prettify"><br><br></span><span style=3D"color:rgb(0,0,136)" class=3D"gmail-=
m_5260688284803056731styled-by-prettify">void</span><span style=3D"color:rg=
b(0,0,0)" class=3D"gmail-m_5260688284803056731styled-by-prettify"> f</span>=
<span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_5260688284803056731st=
yled-by-prettify">()</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-=
m_5260688284803056731styled-by-prettify"> </span><span style=3D"color:rgb(1=
02,102,0)" class=3D"gmail-m_5260688284803056731styled-by-prettify">{</span>=
<span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_5260688284803056731styled=
-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)" c=
lass=3D"gmail-m_5260688284803056731styled-by-prettify">base</span><span sty=
le=3D"color:rgb(102,102,0)" class=3D"gmail-m_5260688284803056731styled-by-p=
rettify">::</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_5260688=
284803056731styled-by-prettify">f</span><span style=3D"color:rgb(102,102,0)=
" class=3D"gmail-m_5260688284803056731styled-by-prettify">();</span><span s=
tyle=3D"color:rgb(0,0,0)" class=3D"gmail-m_5260688284803056731styled-by-pre=
ttify"><br></span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_526=
0688284803056731styled-by-prettify">}</span><span style=3D"color:rgb(0,0,0)=
" class=3D"gmail-m_5260688284803056731styled-by-prettify"><br></span></div>=
</code></div><br>And you also have to write <code class=3D"gmail-m_52606882=
84803056731prettyprint"><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_5=
260688284803056731styled-by-prettify">A</span><span style=3D"color:rgb(102,=
102,0)" class=3D"gmail-m_5260688284803056731styled-by-prettify"><</span>=
<span style=3D"color:rgb(102,0,102)" class=3D"gmail-m_5260688284803056731st=
yled-by-prettify">Value</span><span style=3D"color:rgb(102,102,0)" class=3D=
"gmail-m_5260688284803056731styled-by-prettify">,</span><span style=3D"colo=
r:rgb(0,0,0)" class=3D"gmail-m_5260688284803056731styled-by-prettify"> I</s=
pan><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_52606882848030567=
31styled-by-prettify">,</span><span style=3D"color:rgb(0,0,0)" class=3D"gma=
il-m_5260688284803056731styled-by-prettify"> J</span><span style=3D"color:r=
gb(102,102,0)" class=3D"gmail-m_5260688284803056731styled-by-prettify">,</s=
pan><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_5260688284803056731st=
yled-by-prettify"> </span><span style=3D"color:rgb(102,0,102)" class=3D"gma=
il-m_5260688284803056731styled-by-prettify">Allocator</span><span style=3D"=
color:rgb(102,102,0)" class=3D"gmail-m_5260688284803056731styled-by-prettif=
y">><span style=3D"color:rgb(0,0,0)"> twice</span>.</span><span style=3D=
"color:rgb(102,102,0)" class=3D"gmail-m_5260688284803056731styled-by-pretti=
fy"></span></code></div></div><span class=3D"gmail-">
</span></blockquote><div><br></div><div>Where? Note that the inherited cons=
tructor was something I missed when updating the OP's example.<br><br><=
div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tue, Dec 13, 20=
16 at 9:16 AM, Miro Knejp <span dir=3D"ltr"><<a href=3D"mailto:miro.knej=
p@gmail.com" target=3D"_blank">miro.knejp@gmail.com</a>></span> wrote:<b=
r><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><span =
class=3D"gmail-"></span><div>template<typename T>=C2=A0</div><div>cla=
ss C : std::conditional_t<..., A, B></div><div>{</div><div>=C2=A0 // =
What's Derived::Base here?</div><div>};<br></div></div></blockquote><di=
v><br></div><div>Right, good point. This is an argument in favour of a gene=
ric way to do this. Thanks!<br>=C2=A0<br></div></div></div>=C2=A0</div></di=
v></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CACGiwhHM0MDnXQV0uy7UaHCB%3DG%3D72p9S=
h3dPvi44%2B2KC7JdYCw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhHM0M=
DnXQV0uy7UaHCB%3DG%3D72p9Sh3dPvi44%2B2KC7JdYCw%40mail.gmail.com</a>.<br />
--001a114312ec5a81df054387b727--
.
Author: Victor Dyachenko <victor.dyachenko@gmail.com>
Date: Tue, 13 Dec 2016 03:10:45 -0800 (PST)
Raw View
------=_Part_1667_1150416848.1481627445595
Content-Type: multipart/alternative;
boundary="----=_Part_1668_1329826911.1481627445595"
------=_Part_1668_1329826911.1481627445595
Content-Type: text/plain; charset=UTF-8
On Tuesday, December 13, 2016 at 1:31:01 PM UTC+3, D. B. wrote:
>
> On Tue, Dec 13, 2016 at 8:43 AM, Victor Dyachenko <victor.d...@gmail.com
> <javascript:>> wrote:
>
>>
>> It is not shorter than
>>
>> using base = A<Value, I, J, Allocator>;
>>
>> void f() {
>> base::f();
>> }
>>
>> And you also have to write A<Value, I, J, Allocator> twice.
>>
>
> Where? Note that the inherited constructor was something I missed when
> updating the OP's example.
>
template<typename Value, std::size_t I, std::size_t J, typename Allocator>
class B : public A<Value, I, J, Allocator> { // <------------- (1)
public:
using A<Value, I, J, Allocator>::A; // <-------------------------- (2)
--
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/a6915f7e-0c3b-4d22-b306-4fac279921a9%40isocpp.org.
------=_Part_1668_1329826911.1481627445595
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Tuesday, December 13, 2016 at 1:31:01 PM UTC+3,=
D. B. wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">=
<div><div class=3D"gmail_quote">On Tue, Dec 13, 2016 at 8:43 AM, Victor Dya=
chenko <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-=
obfuscated-mailto=3D"OhiZ8bxvCQAJ" rel=3D"nofollow" onmousedown=3D"this.hre=
f=3D'javascript:';return true;" onclick=3D"this.href=3D'javascr=
ipt:';return true;">victor.d...@gmail.com</a>></span> wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div><br>It =
is not shorter than <br><span style=3D"font-family:monospace,monospace"><br=
></span><div style=3D"background-color:rgb(250,250,250);border-color:rgb(18=
7,187,187);border-style:solid;border-width:1px"><code><div><span style=3D"c=
olor:rgb(0,0,136)">using</span><span style=3D"color:rgb(0,0,0)"> </span><sp=
an style=3D"color:rgb(0,0,136)">base</span><span style=3D"color:rgb(0,0,0)"=
> </span><span style=3D"color:rgb(102,102,0)">=3D</span><span style=3D"colo=
r:rgb(0,0,0)"> A</span><span style=3D"color:rgb(102,102,0)"><</span><spa=
n style=3D"color:rgb(102,0,102)">Value</span><span style=3D"color:rgb(102,1=
02,0)">,</span><span style=3D"color:rgb(0,0,0)"> I</span><span style=3D"col=
or:rgb(102,102,0)">,</span><span style=3D"color:rgb(0,0,0)"> J</span><span =
style=3D"color:rgb(102,102,0)">,</span><span style=3D"color:rgb(0,0,0)"> </=
span><span style=3D"color:rgb(102,0,102)">Allocator</span><span style=3D"co=
lor:rgb(102,102,0)">>;</span><span style=3D"color:rgb(0,0,0)"><br><br></=
span><span style=3D"color:rgb(0,0,136)">void</span><span style=3D"color:rgb=
(0,0,0)"> f</span><span style=3D"color:rgb(102,102,0)">()</span><span style=
=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb(102,102,0)">{</span>=
<span style=3D"color:rgb(0,0,0)"><br>=C2=A0 =C2=A0 </span><span style=3D"co=
lor:rgb(0,0,136)">base</span><span style=3D"color:rgb(102,102,0)">::</span>=
<span style=3D"color:rgb(0,0,0)">f</span><span style=3D"color:rgb(102,102,0=
)">();</span><span style=3D"color:rgb(0,0,0)"><br></span><span style=3D"col=
or:rgb(102,102,0)">}</span><span style=3D"color:rgb(0,0,0)"><br></span></di=
v></code></div><br>And you also have to write <code><span style=3D"color:rg=
b(0,0,0)">A</span><span style=3D"color:rgb(102,102,0)"><</span><span sty=
le=3D"color:rgb(102,0,102)">Value</span><span style=3D"color:rgb(102,102,0)=
">,</span><span style=3D"color:rgb(0,0,0)"> I</span><span style=3D"color:rg=
b(102,102,0)">,</span><span style=3D"color:rgb(0,0,0)"> J</span><span style=
=3D"color:rgb(102,102,0)">,</span><span style=3D"color:rgb(0,0,0)"> </span>=
<span style=3D"color:rgb(102,0,102)">Allocator</span><span style=3D"color:r=
gb(102,102,0)">><span style=3D"color:rgb(0,0,0)"> twice</span>.</span><s=
pan style=3D"color:rgb(102,102,0)"></span></code></div></div><span>
</span></blockquote><div><br></div><div>Where? Note that the inherited cons=
tructor was something I missed when updating the OP's example.<br></div=
></div></div></div></blockquote><div>=C2=A0<br><span style=3D"font-family:m=
onospace,monospace">template<typename Value, std::size_t I, std::size_t =
J, typename Allocator><br>class B : public A<Value, I, J, Allocator&g=
t; { // <------------- (1)<br>public:<br>=C2=A0=C2=A0=C2=A0 using A<V=
alue, I, J, Allocator>::A;</span> // <-------------------------- (2)<=
br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/a6915f7e-0c3b-4d22-b306-4fac279921a9%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a6915f7e-0c3b-4d22-b306-4fac279921a9=
%40isocpp.org</a>.<br />
------=_Part_1668_1329826911.1481627445595--
------=_Part_1667_1150416848.1481627445595--
.
Author: "D. B." <db0451@gmail.com>
Date: Tue, 13 Dec 2016 11:25:35 +0000
Raw View
--001a11443f0cac31d00543887a3e
Content-Type: text/plain; charset=UTF-8
On Tue, Dec 13, 2016 at 11:10 AM, Victor Dyachenko <
victor.dyachenko@gmail.com> wrote:
>
>
> template<typename Value, std::size_t I, std::size_t J, typename Allocator>
> class B : public A<Value, I, J, Allocator> { // <------------- (1)
> public:
> using A<Value, I, J, Allocator>::A; // <-------------------------- (2)
>
>
=>
Note that the inherited constructor was something I missed when updating
> the OP's example.
>
On Mon, Dec 12, 2016 at 9:54 PM, D. B. <db0451@gmail.com> wrote:
> ...and to be complete, I should've written this instead in B:
>
> using B::A::A
>
--
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/CACGiwhGZYTEDQ96WvR0tHGSJd20zJFCJdaSJWVf%3DDv%2B1Tw70LA%40mail.gmail.com.
--001a11443f0cac31d00543887a3e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
ue, Dec 13, 2016 at 11:10 AM, Victor Dyachenko <span dir=3D"ltr"><<a hre=
f=3D"mailto:victor.dyachenko@gmail.com" target=3D"_blank">victor.dyachenko@=
gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><div dir=3D"ltr"><br><br><span class=3D"gmail-"></span><span sty=
le=3D"font-family:monospace,monospace"><span class=3D"gmail-">template<t=
ypename Value, std::size_t I, std::size_t J, typename Allocator></span><=
/span><br><span style=3D"font-family:monospace,monospace"><span class=3D"gm=
ail-"></span></span><div><span style=3D"font-family:monospace,monospace">cl=
ass B : public A<Value, I, J, Allocator> { // <------------- (1)<b=
r>public:<br>=C2=A0=C2=A0=C2=A0 using A<Value, I, J, Allocator>::A;</=
span> // <-------------------------- (2)<br><br></div></div></blockquote=
><div><br>=3D><br><br><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">=
<span class=3D"gmail-im">Note that the inherited constructor was something =
I missed when updating the OP's example.</span><br></blockquote><div><d=
iv class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Mon, Dec 12, 201=
6 at 9:54 PM, D. B. <span dir=3D"ltr"><<a href=3D"mailto:db0451@gmail.co=
m" target=3D"_blank">db0451@gmail.com</a>></span> wrote:<br><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">...and to be complet=
e, I should've written this instead in B:<br><br><div style=3D"margin-l=
eft:40px"><span style=3D"font-family:monospace,monospace">using B::A::A<br>=
</span></div></div></blockquote></div><br></div>=C2=A0</div></div></div><br=
></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CACGiwhGZYTEDQ96WvR0tHGSJd20zJFCJdaSJ=
WVf%3DDv%2B1Tw70LA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhGZYTED=
Q96WvR0tHGSJd20zJFCJdaSJWVf%3DDv%2B1Tw70LA%40mail.gmail.com</a>.<br />
--001a11443f0cac31d00543887a3e--
.
Author: Victor Dyachenko <victor.dyachenko@gmail.com>
Date: Tue, 13 Dec 2016 03:27:37 -0800 (PST)
Raw View
------=_Part_1741_1009864944.1481628457225
Content-Type: multipart/alternative;
boundary="----=_Part_1742_1611078456.1481628457225"
------=_Part_1742_1611078456.1481628457225
Content-Type: text/plain; charset=UTF-8
Could you provide full code?
On Tuesday, December 13, 2016 at 2:25:38 PM UTC+3, D. B. wrote:
>
> On Tue, Dec 13, 2016 at 11:10 AM, Victor Dyachenko <victor.d...@gmail.com
> <javascript:>> wrote:
>
>>
>>
>> template<typename Value, std::size_t I, std::size_t J, typename Allocator>
>> class B : public A<Value, I, J, Allocator> { // <------------- (1)
>> public:
>> using A<Value, I, J, Allocator>::A; // <--------------------------
>> (2)
>>
>>
> =>
>
> Note that the inherited constructor was something I missed when updating
>> the OP's example.
>>
>
> On Mon, Dec 12, 2016 at 9:54 PM, D. B. <db0...@gmail.com <javascript:>>
> wrote:
>
>> ...and to be complete, I should've written this instead in B:
>>
>> using B::A::A
>>
>
>
>
>
--
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/e49f9904-705d-46bc-bdfa-72fa56f5a18c%40isocpp.org.
------=_Part_1742_1611078456.1481628457225
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Could you provide full code?<br><br>On Tuesday, December 1=
3, 2016 at 2:25:38 PM UTC+3, D. B. wrote:<blockquote class=3D"gmail_quote" =
style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-l=
eft: 1ex;"><div dir=3D"ltr"><div><div class=3D"gmail_quote">On Tue, Dec 13,=
2016 at 11:10 AM, Victor Dyachenko <span dir=3D"ltr"><<a href=3D"javasc=
ript:" target=3D"_blank" gdf-obfuscated-mailto=3D"--us3rdyCQAJ" rel=3D"nofo=
llow" onmousedown=3D"this.href=3D'javascript:';return true;" onclic=
k=3D"this.href=3D'javascript:';return true;">victor.d...@gmail.com<=
/a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">=
<div dir=3D"ltr"><br><br><span></span><span style=3D"font-family:monospace,=
monospace"><span>template<typename Value, std::size_t I, std::size_t J, =
typename Allocator></span></span><br><span style=3D"font-family:monospac=
e,monospace"><span></span></span><div><span style=3D"font-family:monospace,=
monospace">class B : public A<Value, I, J, Allocator> { // <------=
------- (1)<br>public:<br>=C2=A0=C2=A0=C2=A0 using A<Value, I, J, Alloca=
tor>::A;</span> // <-------------------------- (2)<br><br></div></div=
></blockquote><div><br>=3D><br><br><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex"><span>Note that the inherited constructor was something I miss=
ed when updating the OP's example.</span><br></blockquote><div><div><br=
><div class=3D"gmail_quote">On Mon, Dec 12, 2016 at 9:54 PM, D. B. <span di=
r=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mail=
to=3D"--us3rdyCQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javasc=
ript:';return true;" onclick=3D"this.href=3D'javascript:';retur=
n true;">db0...@gmail.com</a>></span> wrote:<br><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex"><div dir=3D"ltr">...and to be complete, I should&=
#39;ve written this instead in B:<br><br><div style=3D"margin-left:40px"><s=
pan style=3D"font-family:monospace,monospace">using B::A::A<br></span></div=
></div></blockquote></div><br></div>=C2=A0</div></div></div><br></div></div=
>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/e49f9904-705d-46bc-bdfa-72fa56f5a18c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e49f9904-705d-46bc-bdfa-72fa56f5a18c=
%40isocpp.org</a>.<br />
------=_Part_1742_1611078456.1481628457225--
------=_Part_1741_1009864944.1481628457225--
.
Author: "D. B." <db0451@gmail.com>
Date: Tue, 13 Dec 2016 11:30:46 +0000
Raw View
--001a11c39b222bf6f80543888db1
Content-Type: text/plain; charset=UTF-8
If I must.
#include <cstddef>
>
> template<typename Value, std::size_t I, std::size_t, typename Allocator>
> class A {
> public:
> void f() {}
> };
>
> template<typename Value, std::size_t I, std::size_t J, typename Allocator>
> class B : public A<Value, I, J, Allocator> {
> public:
> * using B::A::A;*
>
> void f() {
> B::A::f();
> }
> };
>
> int main()
> {
> B<bool, 42, 13, double> b;
> }
>
--
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/CACGiwhGS4TuojqoRo8o5cvGD70vHvoRECL%2BBvCqWCD8J%2BbsCQw%40mail.gmail.com.
--001a11c39b222bf6f80543888db1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">If I must.<br><div><br><div class=3D"gmail_extra"><div cla=
ss=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 =
..8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div sty=
le=3D"margin-left:40px"><span style=3D"font-family:monospace,monospace">#in=
clude <cstddef><br><br>template<typename Value, std::size_t I, std=
::size_t, typename Allocator><br>class A {<br>public:<span class=3D""><b=
r>=C2=A0=C2=A0=C2=A0 void f() {}<br>};<br><br>template<typename Value, s=
td::size_t I, std::size_t J, typename Allocator><br>class B : public A&l=
t;Value, I, J, Allocator> {<br>public:<br><span style=3D"background-colo=
r:rgb(0,255,0)"><b>=C2=A0=C2=A0=C2=A0 using B::A::A;</b></span><br><br>=C2=
=A0=C2=A0=C2=A0 void f() {<br></span>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 B::A::f();<br>=C2=A0=C2=A0=C2=A0 }<br>};<br><br>int main()<br>{<br>=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 B<bool, 42, 13, double> b;=
<br>}<br></span></div></div>
</blockquote></div><br></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CACGiwhGS4TuojqoRo8o5cvGD70vHvoRECL%2=
BBvCqWCD8J%2BbsCQw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhGS4Tuo=
jqoRo8o5cvGD70vHvoRECL%2BBvCqWCD8J%2BbsCQw%40mail.gmail.com</a>.<br />
--001a11c39b222bf6f80543888db1--
.
Author: Victor Dyachenko <victor.dyachenko@gmail.com>
Date: Tue, 13 Dec 2016 03:39:01 -0800 (PST)
Raw View
------=_Part_732_1093297065.1481629141572
Content-Type: multipart/alternative;
boundary="----=_Part_733_265725102.1481629141573"
------=_Part_733_265725102.1481629141573
Content-Type: text/plain; charset=UTF-8
Looks like we are looking to different parts of the snippet :-)
Constructor is not the only class member. See here
void f() {
B::A::f();
}
You duplicate names of the derived and base classes. If they change you
will need to edit *every* such occurrence. An in the reality they don't
have such short names as "A". With base class alias you can easily change
base class without affecting the code in derived class.
On Tuesday, December 13, 2016 at 2:30:48 PM UTC+3, D. B. wrote:
>
> If I must.
>
> #include <cstddef>
>>
>> template<typename Value, std::size_t I, std::size_t, typename Allocator>
>> class A {
>> public:
>> void f() {}
>> };
>>
>> template<typename Value, std::size_t I, std::size_t J, typename Allocator>
>> class B : public A<Value, I, J, Allocator> {
>> public:
>> * using B::A::A;*
>>
>> void f() {
>> B::A::f();
>> }
>> };
>>
>> int main()
>> {
>> B<bool, 42, 13, double> b;
>> }
>>
>
>
--
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/6f515163-4fb8-4cf9-a226-aaa42d8aadeb%40isocpp.org.
------=_Part_733_265725102.1481629141573
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Looks like we are looking to different parts of the snippe=
t :-) <br>Constructor is not the only class member.=C2=A0 See here<br><span=
style=3D"font-family:monospace,monospace"><span><br></span></span><div sty=
le=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187=
); border-style: solid; border-width: 1px; overflow-wrap: break-word;" clas=
s=3D"prettyprint"><code class=3D"prettyprint"><div class=3D"subprettyprint"=
><span style=3D"color: #000;" class=3D"styled-by-prettify">=C2=A0 =C2=A0 </=
span><span style=3D"color: #008;" class=3D"styled-by-prettify">void</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> f</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"co=
lor: #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>=C2=A0 =C2=A0 =C2=A0 =C2=A0 B</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">A</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"style=
d-by-prettify">();</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span></div></code></div><br>You duplicate names of the derived=
and base classes. If they change you will need to edit <b>every</b> such o=
ccurrence. An in the reality they don't have such short names as "=
A". With base class alias you can easily change base class without aff=
ecting the code in derived class.<br><br>On Tuesday, December 13, 2016 at 2=
:30:48 PM UTC+3, D. B. wrote:<blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><=
div dir=3D"ltr">If I must.<br><div><br><div><div class=3D"gmail_quote"><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr"><div style=3D"margin-left:40px"=
><span style=3D"font-family:monospace,monospace">#include <cstddef><b=
r><br>template<typename Value, std::size_t I, std::size_t, typename Allo=
cator><br>class A {<br>public:<span><br>=C2=A0=C2=A0=C2=A0 void f() {}<b=
r>};<br><br>template<typename Value, std::size_t I, std::size_t J, typen=
ame Allocator><br>class B : public A<Value, I, J, Allocator> {<br>=
public:<br><span style=3D"background-color:rgb(0,255,0)"><b>=C2=A0=C2=A0=C2=
=A0 using B::A::A;</b></span><br><br>=C2=A0=C2=A0=C2=A0 void f() {<br></spa=
n>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 B::A::f();<br>=C2=A0=C2=A0=C2=
=A0 }<br>};<br><br>int main()<br>{<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 B<bool, 42, 13, double> b;<br>}<br></span></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/6f515163-4fb8-4cf9-a226-aaa42d8aadeb%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6f515163-4fb8-4cf9-a226-aaa42d8aadeb=
%40isocpp.org</a>.<br />
------=_Part_733_265725102.1481629141573--
------=_Part_732_1093297065.1481629141572--
.
Author: "D. B." <db0451@gmail.com>
Date: Tue, 13 Dec 2016 11:46:56 +0000
Raw View
--001a11423f44fe47f5054388c6a9
Content-Type: text/plain; charset=UTF-8
Sure, I agree that there are reasons to want a more generic option. I just
meant that avoiding repetition of template arguments is not specifically
one of them, since the Derived::Base syntax avoids that already (while,
yes, still being somewhat redundant/not generic).
--
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/CACGiwhGTaSvkHz7sMs3CT7iZu7ky5cHXdDfpBpYw8%2BbUsAWQEg%40mail.gmail.com.
--001a11423f44fe47f5054388c6a9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Sure, I agree that there are reasons to want a more generi=
c option. I just meant that avoiding repetition of template arguments is no=
t specifically one of them, since the Derived::Base syntax avoids that alre=
ady (while, yes, still being somewhat redundant/not generic).<br><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CACGiwhGTaSvkHz7sMs3CT7iZu7ky5cHXdDfp=
BpYw8%2BbUsAWQEg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhGTaSvkHz=
7sMs3CT7iZu7ky5cHXdDfpBpYw8%2BbUsAWQEg%40mail.gmail.com</a>.<br />
--001a11423f44fe47f5054388c6a9--
.