Topic: Parameter packs in using declarations
Author: David Krauss <potswa@gmail.com>
Date: Thu, 8 Aug 2013 01:37:14 -0700 (PDT)
Raw View
------=_Part_2951_32200709.1375951034674
Content-Type: text/plain; charset=ISO-8859-1
I'm currently using this utility class to combine multiple functors into
one functor with an overloaded operator() (). It ain't pretty, even if you
replace the wacky std::common_type tag-specialization with a conventional
self-contained metafunction.
template< typename ... t >
struct amalgam : t ... {
amalgam( t ... in ) : t( std::move( in ) ) ... {}
protected:
void operator () ( struct amalgam_tag ) = delete;
};
template< typename ftor >
struct add_ftor;
namespace std {
template< typename base, typename ftor >
struct common_type< base, cplus::util::add_ftor< ftor > > {
typedef struct : base {
using base::operator ();
using ftor::operator ();
using base::base;
} type;
};
template< typename ... t >
struct amalgam_ftor
: std::common_type< amalgam< t ... >, add_ftor< t > ... >::type {
using std::common_type< amalgam< t ... >, add_ftor< t > ... >::type::
type;
};
All this is necessary because without a using declaration, the functions
produce a name resolution ambiguity instead of overloading. But no using
declaration is possible directly in amalgam_ftor because it would not
expand the parameter pack.
This represents boilerplate that must be repeated every time an overloaded
member is to be accumulated from a parameter pack. The resulting overuse of
the function call operator led to another problem; see my other post here
today.
If a pack expansion were allowed inside a using declaration, then all that
could look like this:
template< typename ... t >
struct amalgam_ftor : t ... {
amalgam_ftor( t ... in ) : t( std::move( in ) ) ... {}
using t::operator () ... ;
};
Is there any particular obstacle to allowing this? Packs are allowed in
many diverse contexts already. The using declaration already must specify
what kind of name exists in the base (i.e. by the typename keyword), so
there isn't room for confusion.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_2951_32200709.1375951034674
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I'm currently using this utility class to combine multiple functors into on=
e functor with an overloaded operator() (). It ain't pretty, even if you re=
place the wacky std::common_type tag-specialization with a conventional sel=
f-contained metafunction.<br><br><div class=3D"prettyprint" style=3D"backgr=
ound-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-st=
yle: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"prett=
yprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D=
"styled-by-prettify">template</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify"><</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">typename</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">...</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> t </span><spa=
n 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: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> amalgam </span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> t </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-prett=
ify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
amalgam</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> t </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">in</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> t</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> std</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">move</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">in</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </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: #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></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">protected</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">operator</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </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: #660;" class=3D"styled-by-prettify">(</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> amalgam_tag </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: #660;" class=3D"s=
tyled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">delete</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">};</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=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: #008=
;" class=3D"styled-by-prettify">typename</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"> ftor </span><span style=3D"color: #660;" cla=
ss=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">struct</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> add_ftor</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">na=
mespace</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> st=
d </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">template</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify"><</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">typename</span><span style=3D"color: #00=
0;" 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"st=
yled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">=
typename</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f=
tor </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">struct</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify"> common_type</span><sp=
an 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">base</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> cplus</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify">util</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">a=
dd_ftor</span><span style=3D"color: #660;" class=3D"styled-by-prettify"><=
;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> ftor </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">></span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">></span><span style=3D"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> </span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">typedef</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">struct</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"> <=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">base</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br> </s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">using</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">base</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">operator</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"sty=
led-by-prettify"><br> </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">using</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> ftor</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">::</span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">operator</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">();</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br> <br> </span><=
span style=3D"color: #008;" class=3D"styled-by-prettify">using</span><span =
style=3D"color: #000;" 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 style=3D"color: #008;" =
class=3D"styled-by-prettify">base</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-prettify">}</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> type</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">};</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></spa=
n><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: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">typename</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;" clas=
s=3D"styled-by-prettify"> t </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">></span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">struct</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> amalgam_ftor<br> </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"=
>common_type</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
"><</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> ama=
lgam</span><span style=3D"color: #660;" class=3D"styled-by-prettify"><</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> t </span><s=
pan 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: #660;" class=3D"styled-by-prettify">>,</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> add_ftor</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify"><</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> t </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">></span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">...</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">>::</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify">type </span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br> </span><sp=
an style=3D"color: #008;" class=3D"styled-by-prettify">using</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> std</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify">common_type</span><span style=3D"color:=
#660;" class=3D"styled-by-prettify"><</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> amalgam</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify"><</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> t </span><span style=3D"color: #660;" class=3D"sty=
led-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"> add=
_ftor</span><span style=3D"color: #660;" class=3D"styled-by-prettify"><<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> t </span><=
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: #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"styled-by-prettify">type</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">type</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></=
code></div><br>All this is necessary because without a using declaration, t=
he functions produce a name resolution ambiguity instead of overloading. Bu=
t no using declaration is possible directly in amalgam_ftor because it woul=
d not expand the parameter pack.<br><br>This represents boilerplate that mu=
st be repeated every time an overloaded member is to be accumulated from a =
parameter pack. The resulting overuse of the function call operator led to =
another problem; see my other post here today.<br><br>If a pack expansion w=
ere allowed inside a using declaration, then all that could look like this:=
<br><br><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,=
250); border-color: rgb(187, 187, 187); border-style: solid; border-width:=
1px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"sub=
prettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">temp=
late</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: #660;" class=3D"styled-by-prettify">...</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> t </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"st=
yled-by-prettify">struct</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> amalgam_ftor </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">:</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> t </span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">...</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br> amalg=
am_ftor</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> t </span><s=
pan 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">in</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">:</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> t<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> std</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">move</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">in</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </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 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"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{}</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">using</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> t</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">::</span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">operator</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">...</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></span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">};</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br></span></div></code></div><br>Is there any particular obstac=
le to allowing this? Packs are allowed in many diverse contexts already. Th=
e using declaration already must specify what kind of name exists in the ba=
se (i.e. by the typename keyword), so there isn't room for confusion.<br>
<p></p>
-- <br />
<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_2951_32200709.1375951034674--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 8 Aug 2013 12:07:32 +0300
Raw View
--001a11c2c6bc01a90704e36bfd47
Content-Type: text/plain; charset=ISO-8859-1
On 8 August 2013 11:37, David Krauss <potswa@gmail.com> wrote:
> I'm currently using this utility class to combine multiple functors into
> one functor with an overloaded operator() (). It ain't pretty, even if you
> replace the wacky std::common_type tag-specialization with a conventional
> self-contained metafunction.
>
> template< typename ... t >
> struct amalgam : t ... {
> amalgam( t ... in ) : t( std::move( in ) ) ... {}
> protected:
> void operator () ( struct amalgam_tag ) = delete;
> };
>
> template< typename ftor >
> struct add_ftor;
>
> namespace std {
> template< typename base, typename ftor >
> struct common_type< base, cplus::util::add_ftor< ftor > > {
> typedef struct : base {
> using base::operator ();
> using ftor::operator ();
>
> using base::base;
> } type;
> };
>
> template< typename ... t >
> struct amalgam_ftor
> : std::common_type< amalgam< t ... >, add_ftor< t > ... >::type {
> using std::common_type< amalgam< t ... >, add_ftor< t > ... >::type::
> type;
> };
>
> All this is necessary because without a using declaration, the functions
> produce a name resolution ambiguity instead of overloading. But no using
> declaration is possible directly in amalgam_ftor because it would not
> expand the parameter pack.
>
> This represents boilerplate that must be repeated every time an overloaded
> member is to be accumulated from a parameter pack. The resulting overuse of
> the function call operator led to another problem; see my other post here
> today.
>
> If a pack expansion were allowed inside a using declaration, then all that
> could look like this:
>
> template< typename ... t >
> struct amalgam_ftor : t ... {
> amalgam_ftor( t ... in ) : t( std::move( in ) ) ... {}
> using t::operator () ... ;
> };
>
> Is there any particular obstacle to allowing this? Packs are allowed in
> many diverse contexts already. The using declaration already must specify
> what kind of name exists in the base (i.e. by the typename keyword), so
> there isn't room for confusion.
>
There's a somewhat related extension issue,
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#1393
Such an extension will most certainly require a proposal paper. I think
many people agree
it would be very useful, both for inheriting constructors and other such
uses, too.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--001a11c2c6bc01a90704e36bfd47
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 8 August 2013 11:37, David Krauss <span dir=3D"ltr"><<a href=
=3D"mailto:potswa@gmail.com" target=3D"_blank">potswa@gmail.com</a>></sp=
an> 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">I'm currently using t=
his utility class to combine multiple functors into one functor with an ove=
rloaded operator() (). It ain't pretty, even if you replace the wacky s=
td::common_type tag-specialization with a conventional self-contained metaf=
unction.<br>
<br><div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div=
><span style=3D"color:rgb(0,0,136)">template</span><span style=3D"color:rgb=
(102,102,0)"><</span><span style> </span><span style=3D"color:rgb(0,0,13=
6)">typename</span><span style> </span><span style=3D"color:rgb(102,102,0)"=
>...</span><span style> t </span><span style=3D"color:rgb(102,102,0)">><=
/span><span style><br>
</span><span style=3D"color:rgb(0,0,136)">struct</span><span style> amalgam=
</span><span style=3D"color:rgb(102,102,0)">:</span><span style> t </span>=
<span style=3D"color:rgb(102,102,0)">...</span><span style> </span><span st=
yle=3D"color:rgb(102,102,0)">{</span><span style><br>
=A0 =A0 amalgam</span><span style=3D"color:rgb(102,102,0)">(</span><span st=
yle> t </span><span style=3D"color:rgb(102,102,0)">...</span><span style> <=
/span><span style=3D"color:rgb(0,0,136)">in</span><span style> </span><span=
style=3D"color:rgb(102,102,0)">)</span><span style> </span><span style=3D"=
color:rgb(102,102,0)">:</span><span style> t</span><span style=3D"color:rgb=
(102,102,0)">(</span><span style> std</span><span style=3D"color:rgb(102,10=
2,0)">::</span><span style>move</span><span style=3D"color:rgb(102,102,0)">=
(</span><span style> </span><span style=3D"color:rgb(0,0,136)">in</span><sp=
an style> </span><span style=3D"color:rgb(102,102,0)">)</span><span style> =
</span><span style=3D"color:rgb(102,102,0)">)</span><span style> </span><sp=
an style=3D"color:rgb(102,102,0)">...</span><span style> </span><span style=
=3D"color:rgb(102,102,0)">{}</span><span style><br>
</span><span style=3D"color:rgb(0,0,136)">protected</span><span style=3D"co=
lor:rgb(102,102,0)">:</span><span style><br>=A0 =A0 </span><span style=3D"c=
olor:rgb(0,0,136)">void</span><span style> </span><span style=3D"color:rgb(=
0,0,136)">operator</span><span style> </span><span style=3D"color:rgb(102,1=
02,0)">()</span><span style> </span><span style=3D"color:rgb(102,102,0)">(<=
/span><span style> </span><span style=3D"color:rgb(0,0,136)">struct</span><=
span style> amalgam_tag </span><span style=3D"color:rgb(102,102,0)">)</span=
><span style> </span><span style=3D"color:rgb(102,102,0)">=3D</span><span s=
tyle> </span><span style=3D"color:rgb(0,0,136)">delete</span><span style=3D=
"color:rgb(102,102,0)">;</span><span style><br>
</span><span style=3D"color:rgb(102,102,0)">};</span><span style><br><br></=
span><span style=3D"color:rgb(0,0,136)">template</span><span style=3D"color=
:rgb(102,102,0)"><</span><span style> </span><span style=3D"color:rgb(0,=
0,136)">typename</span><span style> ftor </span><span style=3D"color:rgb(10=
2,102,0)">></span><span style><br>
</span><span style=3D"color:rgb(0,0,136)">struct</span><span style> add_fto=
r</span><span style=3D"color:rgb(102,102,0)">;</span><span style><br><br></=
span><span style=3D"color:rgb(0,0,136)">namespace</span><span style> std </=
span><span style=3D"color:rgb(102,102,0)">{</span><span style><br>
</span><span style=3D"color:rgb(0,0,136)">template</span><span style=3D"col=
or:rgb(102,102,0)"><</span><span style> </span><span style=3D"color:rgb(=
0,0,136)">typename</span><span style> </span><span style=3D"color:rgb(0,0,1=
36)">base</span><span style=3D"color:rgb(102,102,0)">,</span><span style> <=
/span><span style=3D"color:rgb(0,0,136)">typename</span><span style> ftor <=
/span><span style=3D"color:rgb(102,102,0)">></span><span style><br>
</span><span style=3D"color:rgb(0,0,136)">struct</span><span style> common_=
type</span><span style=3D"color:rgb(102,102,0)"><</span><span style> </s=
pan><span style=3D"color:rgb(0,0,136)">base</span><span style=3D"color:rgb(=
102,102,0)">,</span><span style> cplus</span><span style=3D"color:rgb(102,1=
02,0)">::</span><span style>util</span><span style=3D"color:rgb(102,102,0)"=
>::</span><span style>add_ftor</span><span style=3D"color:rgb(102,102,0)">&=
lt;</span><span style> ftor </span><span style=3D"color:rgb(102,102,0)">>=
;</span><span style> </span><span style=3D"color:rgb(102,102,0)">></span=
><span style> </span><span style=3D"color:rgb(102,102,0)">{</span><span sty=
le><br>
=A0 =A0 </span><span style=3D"color:rgb(0,0,136)">typedef</span><span style=
> </span><span style=3D"color:rgb(0,0,136)">struct</span><span style> </spa=
n><span style=3D"color:rgb(102,102,0)">:</span><span style> </span><span st=
yle=3D"color:rgb(0,0,136)">base</span><span style> </span><span style=3D"co=
lor:rgb(102,102,0)">{</span><span style><br>
=A0 =A0 =A0 =A0 </span><span style=3D"color:rgb(0,0,136)">using</span><span=
style> </span><span style=3D"color:rgb(0,0,136)">base</span><span style=3D=
"color:rgb(102,102,0)">::</span><span style=3D"color:rgb(0,0,136)">operator=
</span><span style> </span><span style=3D"color:rgb(102,102,0)">();</span><=
span style><br>
=A0 =A0 =A0 =A0 </span><span style=3D"color:rgb(0,0,136)">using</span><span=
style> ftor</span><span style=3D"color:rgb(102,102,0)">::</span><span styl=
e=3D"color:rgb(0,0,136)">operator</span><span style> </span><span style=3D"=
color:rgb(102,102,0)">();</span><span style><br>
=A0 =A0 =A0 =A0 <br>=A0 =A0 =A0 =A0 </span><span style=3D"color:rgb(0,0,136=
)">using</span><span style> </span><span style=3D"color:rgb(0,0,136)">base<=
/span><span style=3D"color:rgb(102,102,0)">::</span><span style=3D"color:rg=
b(0,0,136)">base</span><span style=3D"color:rgb(102,102,0)">;</span><span s=
tyle><br>
=A0 =A0 </span><span style=3D"color:rgb(102,102,0)">}</span><span style> ty=
pe</span><span style=3D"color:rgb(102,102,0)">;</span><span style><br></spa=
n><span style=3D"color:rgb(102,102,0)">};</span><span style><br><br></span>=
<span style=3D"color:rgb(0,0,136)">template</span><span style=3D"color:rgb(=
102,102,0)"><</span><span style> </span><span style=3D"color:rgb(0,0,136=
)">typename</span><span style> </span><span style=3D"color:rgb(102,102,0)">=
....</span><span style> t </span><span style=3D"color:rgb(102,102,0)">></=
span><span style><br>
</span><span style=3D"color:rgb(0,0,136)">struct</span><span style> amalgam=
_ftor<br>=A0 =A0 </span><span style=3D"color:rgb(102,102,0)">:</span><span =
style> std</span><span style=3D"color:rgb(102,102,0)">::</span><span style>=
common_type</span><span style=3D"color:rgb(102,102,0)"><</span><span sty=
le> amalgam</span><span style=3D"color:rgb(102,102,0)"><</span><span sty=
le> t </span><span style=3D"color:rgb(102,102,0)">...</span><span style> </=
span><span style=3D"color:rgb(102,102,0)">>,</span><span style> add_ftor=
</span><span style=3D"color:rgb(102,102,0)"><</span><span style> t </spa=
n><span style=3D"color:rgb(102,102,0)">></span><span style> </span><span=
style=3D"color:rgb(102,102,0)">...</span><span style> </span><span style=
=3D"color:rgb(102,102,0)">>::</span><span style>type </span><span style=
=3D"color:rgb(102,102,0)">{</span><span style><br>
=A0 =A0 </span><span style=3D"color:rgb(0,0,136)">using</span><span style> =
std</span><span style=3D"color:rgb(102,102,0)">::</span><span style>common_=
type</span><span style=3D"color:rgb(102,102,0)"><</span><span style> ama=
lgam</span><span style=3D"color:rgb(102,102,0)"><</span><span style> t <=
/span><span style=3D"color:rgb(102,102,0)">...</span><span style> </span><s=
pan style=3D"color:rgb(102,102,0)">>,</span><span style> add_ftor</span>=
<span style=3D"color:rgb(102,102,0)"><</span><span style> t </span><span=
style=3D"color:rgb(102,102,0)">></span><span style> </span><span style=
=3D"color:rgb(102,102,0)">...</span><span style> </span><span style=3D"colo=
r:rgb(102,102,0)">>::</span><span style>type</span><span style=3D"color:=
rgb(102,102,0)">::</span><span style>type</span><span style=3D"color:rgb(10=
2,102,0)">;</span><span style><br>
</span><span style=3D"color:rgb(102,102,0)">};</span><span style><br></span=
></div></code></div><br>All this is necessary because without a using decla=
ration, the functions produce a name resolution ambiguity instead of overlo=
ading. But no using declaration is possible directly in amalgam_ftor becaus=
e it would not expand the parameter pack.<br>
<br>This represents boilerplate that must be repeated every time an overloa=
ded member is to be accumulated from a parameter pack. The resulting overus=
e of the function call operator led to another problem; see my other post h=
ere today.<br>
<br>If a pack expansion were allowed inside a using declaration, then all t=
hat could look like this:<br><br><div style=3D"background-color:rgb(250,250=
,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;wor=
d-wrap:break-word">
<code><div><span style=3D"color:rgb(0,0,136)">template</span><span style=3D=
"color:rgb(102,102,0)"><</span><span style> </span><span style=3D"color:=
rgb(0,0,136)">typename</span><span style> </span><span style=3D"color:rgb(1=
02,102,0)">...</span><span style> t </span><span style=3D"color:rgb(102,102=
,0)">></span><span style><br>
</span><span style=3D"color:rgb(0,0,136)">struct</span><span style> amalgam=
_ftor </span><span style=3D"color:rgb(102,102,0)">:</span><span style> t </=
span><span style=3D"color:rgb(102,102,0)">...</span><span style> </span><sp=
an style=3D"color:rgb(102,102,0)">{</span><span style><br>
=A0 =A0 amalgam_ftor</span><span style=3D"color:rgb(102,102,0)">(</span><sp=
an style> t </span><span style=3D"color:rgb(102,102,0)">...</span><span sty=
le> </span><span style=3D"color:rgb(0,0,136)">in</span><span style> </span>=
<span style=3D"color:rgb(102,102,0)">)</span><span style> </span><span styl=
e=3D"color:rgb(102,102,0)">:</span><span style> t</span><span style=3D"colo=
r:rgb(102,102,0)">(</span><span style> std</span><span style=3D"color:rgb(1=
02,102,0)">::</span><span style>move</span><span style=3D"color:rgb(102,102=
,0)">(</span><span style> </span><span style=3D"color:rgb(0,0,136)">in</spa=
n><span style> </span><span style=3D"color:rgb(102,102,0)">)</span><span st=
yle> </span><span style=3D"color:rgb(102,102,0)">)</span><span style> </spa=
n><span style=3D"color:rgb(102,102,0)">...</span><span style> </span><span =
style=3D"color:rgb(102,102,0)">{}</span><span style><br>
=A0 =A0 </span><span style=3D"color:rgb(0,0,136)">using</span><span style> =
t</span><span style=3D"color:rgb(102,102,0)">::</span><span style=3D"color:=
rgb(0,0,136)">operator</span><span style> </span><span style=3D"color:rgb(1=
02,102,0)">()</span><span style> </span><span style=3D"color:rgb(102,102,0)=
">...</span><span style> </span><span style=3D"color:rgb(102,102,0)">;</spa=
n><span style><br>
</span><span style=3D"color:rgb(102,102,0)">};</span><span style><br></span=
></div></code></div><br>Is there any particular obstacle to allowing this? =
Packs are allowed in many diverse contexts already. The using declaration a=
lready must specify what kind of name exists in the base (i.e. by the typen=
ame keyword), so there isn't room for confusion.<span class=3D""><font =
color=3D"#888888"><br>
</font></span></blockquote><div><br></div><div>There's a somewhat relat=
ed extension issue,<br><a href=3D"http://www.open-std.org/jtc1/sc22/wg21/do=
cs/cwg_closed.html#1393">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_cl=
osed.html#1393</a><br>
<br></div><div>Such an extension will most certainly require a proposal pap=
er. I think many people agree<br>it would be very useful, both for inheriti=
ng constructors and other such uses, too.<br></div></div><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
<br />
<br />
--001a11c2c6bc01a90704e36bfd47--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Thu, 8 Aug 2013 03:52:36 -0700 (PDT)
Raw View
------=_Part_4513_28009094.1375959156114
Content-Type: text/plain; charset=ISO-8859-1
On Thursday, August 8, 2013 1:37:14 AM UTC-7, David Krauss wrote:
>
> I'm currently using this utility class to combine multiple functors into
> one functor with an overloaded operator() (). It ain't pretty, even if you
> replace the wacky std::common_type tag-specialization with a conventional
> self-contained metafunction.
>
> template< typename ... t >
> struct amalgam : t ... {
> amalgam( t ... in ) : t( std::move( in ) ) ... {}
> protected:
> void operator () ( struct amalgam_tag ) = delete;
> };
>
> template< typename ftor >
> struct add_ftor;
>
> namespace std {
> template< typename base, typename ftor >
> struct common_type< base, cplus::util::add_ftor< ftor > > {
> typedef struct : base {
> using base::operator ();
> using ftor::operator ();
>
> using base::base;
> } type;
> };
>
> template< typename ... t >
> struct amalgam_ftor
> : std::common_type< amalgam< t ... >, add_ftor< t > ... >::type {
> using std::common_type< amalgam< t ... >, add_ftor< t > ... >::type::
> type;
> };
>
> All this is necessary because without a using declaration, the functions
> produce a name resolution ambiguity instead of overloading. But no using
> declaration is possible directly in amalgam_ftor because it would not
> expand the parameter pack.
>
> This represents boilerplate that must be repeated every time an overloaded
> member is to be accumulated from a parameter pack. The resulting overuse of
> the function call operator led to another problem; see my other post here
> today.
>
> If a pack expansion were allowed inside a using declaration, then all that
> could look like this:
>
> template< typename ... t >
> struct amalgam_ftor : t ... {
> amalgam_ftor( t ... in ) : t( std::move( in ) ) ... {}
> using t::operator () ... ;
> };
>
> Is there any particular obstacle to allowing this? Packs are allowed in
> many diverse contexts already. The using declaration already must specify
> what kind of name exists in the base (i.e. by the typename keyword), so
> there isn't room for confusion.
>
Currently (I think), all the places where `...` can unpack some construct
are comma-delimited lists. So this would be rather new, as you're basically
unpacking a number of actual *statements*, rather than just expressions.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_4513_28009094.1375959156114
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Thursday, August 8, 2013 1:37:14 AM UTC-7, David Krauss wrote:<blockquot=
e class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: =
1px #ccc solid;padding-left: 1ex;">I'm currently using this utility class t=
o combine multiple functors into one functor with an overloaded operator() =
(). It ain't pretty, even if you replace the wacky std::common_type tag-spe=
cialization with a conventional self-contained metafunction.<br><br><div st=
yle=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);bord=
er-style:solid;border-width:1px;word-wrap:break-word"><code><div><span styl=
e=3D"color:#008">template</span><span style=3D"color:#660"><</span><span=
style=3D"color:#000"> </span><span style=3D"color:#008">typename</span><sp=
an style=3D"color:#000"> </span><span style=3D"color:#660">...</span><span =
style=3D"color:#000"> t </span><span style=3D"color:#660">></span><span =
style=3D"color:#000"><br></span><span style=3D"color:#008">struct</span><sp=
an style=3D"color:#000"> amalgam </span><span style=3D"color:#660">:</span>=
<span style=3D"color:#000"> t </span><span style=3D"color:#660">...</span><=
span style=3D"color:#000"> </span><span style=3D"color:#660">{</span><span =
style=3D"color:#000"><br> amalgam</span><span style=3D"color:#=
660">(</span><span style=3D"color:#000"> t </span><span style=3D"color:#660=
">...</span><span style=3D"color:#000"> </span><span style=3D"color:#008">i=
n</span><span style=3D"color:#000"> </span><span style=3D"color:#660">)</sp=
an><span style=3D"color:#000"> </span><span style=3D"color:#660">:</span><s=
pan style=3D"color:#000"> t</span><span style=3D"color:#660">(</span><span =
style=3D"color:#000"> std</span><span style=3D"color:#660">::</span><span s=
tyle=3D"color:#000">move</span><span style=3D"color:#660">(</span><span sty=
le=3D"color:#000"> </span><span style=3D"color:#008">in</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">)</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#660">)</span><span style=3D"color:=
#000"> </span><span style=3D"color:#660">...</span><span style=3D"color:#00=
0"> </span><span style=3D"color:#660">{}</span><span style=3D"color:#000"><=
br></span><span style=3D"color:#008">protected</span><span style=3D"color:#=
660">:</span><span style=3D"color:#000"><br> </span><span styl=
e=3D"color:#008">void</span><span style=3D"color:#000"> </span><span style=
=3D"color:#008">operator</span><span style=3D"color:#000"> </span><span sty=
le=3D"color:#660">()</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">(</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#008">struct</span><span style=3D"color:#000"> amalgam_tag </span><spa=
n style=3D"color:#660">)</span><span style=3D"color:#000"> </span><span sty=
le=3D"color:#660">=3D</span><span style=3D"color:#000"> </span><span style=
=3D"color:#008">delete</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"><br></span><span style=3D"color:#660">};</span><span style=
=3D"color:#000"><br><br></span><span style=3D"color:#008">template</span><s=
pan style=3D"color:#660"><</span><span style=3D"color:#000"> </span><spa=
n style=3D"color:#008">typename</span><span style=3D"color:#000"> ftor </sp=
an><span style=3D"color:#660">></span><span style=3D"color:#000"><br></s=
pan><span style=3D"color:#008">struct</span><span style=3D"color:#000"> add=
_ftor</span><span style=3D"color:#660">;</span><span style=3D"color:#000"><=
br><br></span><span style=3D"color:#008">namespace</span><span style=3D"col=
or:#000"> std </span><span style=3D"color:#660">{</span><span style=3D"colo=
r:#000"><br></span><span style=3D"color:#008">template</span><span style=3D=
"color:#660"><</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#008">typename</span><span style=3D"color:#000"> </span><span style=3D=
"color:#008">base</span><span style=3D"color:#660">,</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#008">typename</span><span style=3D=
"color:#000"> ftor </span><span style=3D"color:#660">></span><span style=
=3D"color:#000"><br></span><span style=3D"color:#008">struct</span><span st=
yle=3D"color:#000"> common_type</span><span style=3D"color:#660"><</span=
><span style=3D"color:#000"> </span><span style=3D"color:#008">base</span><=
span style=3D"color:#660">,</span><span style=3D"color:#000"> cplus</span><=
span style=3D"color:#660">::</span><span style=3D"color:#000">util</span><s=
pan style=3D"color:#660">::</span><span style=3D"color:#000">add_ftor</span=
><span style=3D"color:#660"><</span><span style=3D"color:#000"> ftor </s=
pan><span style=3D"color:#660">></span><span style=3D"color:#000"> </spa=
n><span style=3D"color:#660">></span><span style=3D"color:#000"> </span>=
<span style=3D"color:#660">{</span><span style=3D"color:#000"><br> &n=
bsp; </span><span style=3D"color:#008">typedef</span><span style=3D"color:#=
000"> </span><span style=3D"color:#008">struct</span><span style=3D"color:#=
000"> </span><span style=3D"color:#660">:</span><span style=3D"color:#000">=
</span><span style=3D"color:#008">base</span><span style=3D"color:#000"> <=
/span><span style=3D"color:#660">{</span><span style=3D"color:#000"><br>&nb=
sp; </span><span style=3D"color:#008">using</span><spa=
n style=3D"color:#000"> </span><span style=3D"color:#008">base</span><span =
style=3D"color:#660">::</span><span style=3D"color:#008">operator</span><sp=
an style=3D"color:#000"> </span><span style=3D"color:#660">();</span><span =
style=3D"color:#000"><br> </span><span style=3D"=
color:#008">using</span><span style=3D"color:#000"> ftor</span><span style=
=3D"color:#660">::</span><span style=3D"color:#008">operator</span><span st=
yle=3D"color:#000"> </span><span style=3D"color:#660">();</span><span style=
=3D"color:#000"><br> <br> &n=
bsp; </span><span style=3D"color:#008">using</span><span style=3D"color:#00=
0"> </span><span style=3D"color:#008">base</span><span style=3D"color:#660"=
>::</span><span style=3D"color:#008">base</span><span style=3D"color:#660">=
;</span><span style=3D"color:#000"><br> </span><span style=3D"=
color:#660">}</span><span style=3D"color:#000"> type</span><span style=3D"c=
olor:#660">;</span><span style=3D"color:#000"><br></span><span style=3D"col=
or:#660">};</span><span style=3D"color:#000"><br><br></span><span style=3D"=
color:#008">template</span><span style=3D"color:#660"><</span><span styl=
e=3D"color:#000"> </span><span style=3D"color:#008">typename</span><span st=
yle=3D"color:#000"> </span><span style=3D"color:#660">...</span><span style=
=3D"color:#000"> t </span><span style=3D"color:#660">></span><span style=
=3D"color:#000"><br></span><span style=3D"color:#008">struct</span><span st=
yle=3D"color:#000"> amalgam_ftor<br> </span><span style=3D"col=
or:#660">:</span><span style=3D"color:#000"> std</span><span style=3D"color=
:#660">::</span><span style=3D"color:#000">common_type</span><span style=3D=
"color:#660"><</span><span style=3D"color:#000"> amalgam</span><span sty=
le=3D"color:#660"><</span><span style=3D"color:#000"> t </span><span sty=
le=3D"color:#660">...</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">>,</span><span style=3D"color:#000"> add_ftor</span><spa=
n style=3D"color:#660"><</span><span style=3D"color:#000"> t </span><spa=
n style=3D"color:#660">></span><span style=3D"color:#000"> </span><span =
style=3D"color:#660">...</span><span style=3D"color:#000"> </span><span sty=
le=3D"color:#660">>::</span><span style=3D"color:#000">type </span><span=
style=3D"color:#660">{</span><span style=3D"color:#000"><br> =
</span><span style=3D"color:#008">using</span><span style=3D"color:#000"> s=
td</span><span style=3D"color:#660">::</span><span style=3D"color:#000">com=
mon_type</span><span style=3D"color:#660"><</span><span style=3D"color:#=
000"> amalgam</span><span style=3D"color:#660"><</span><span style=3D"co=
lor:#000"> t </span><span style=3D"color:#660">...</span><span style=3D"col=
or:#000"> </span><span style=3D"color:#660">>,</span><span style=3D"colo=
r:#000"> add_ftor</span><span style=3D"color:#660"><</span><span style=
=3D"color:#000"> t </span><span style=3D"color:#660">></span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">...</span><span style=3D=
"color:#000"> </span><span style=3D"color:#660">>::</span><span style=3D=
"color:#000">type</span><span style=3D"color:#660">::</span><span style=3D"=
color:#000">type</span><span style=3D"color:#660">;</span><span style=3D"co=
lor:#000"><br></span><span style=3D"color:#660">};</span><span style=3D"col=
or:#000"><br></span></div></code></div><br>All this is necessary because wi=
thout a using declaration, the functions produce a name resolution ambiguit=
y instead of overloading. But no using declaration is possible directly in =
amalgam_ftor because it would not expand the parameter pack.<br><br>This re=
presents boilerplate that must be repeated every time an overloaded member =
is to be accumulated from a parameter pack. The resulting overuse of the fu=
nction call operator led to another problem; see my other post here today.<=
br><br>If a pack expansion were allowed inside a using declaration, then al=
l that could look like this:<br><br><div style=3D"background-color:rgb(250,=
250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;=
word-wrap:break-word"><code><div><span style=3D"color:#008">template</span>=
<span style=3D"color:#660"><</span><span style=3D"color:#000"> </span><s=
pan style=3D"color:#008">typename</span><span style=3D"color:#000"> </span>=
<span style=3D"color:#660">...</span><span style=3D"color:#000"> t </span><=
span style=3D"color:#660">></span><span style=3D"color:#000"><br></span>=
<span style=3D"color:#008">struct</span><span style=3D"color:#000"> amalgam=
_ftor </span><span style=3D"color:#660">:</span><span style=3D"color:#000">=
t </span><span style=3D"color:#660">...</span><span style=3D"color:#000"> =
</span><span style=3D"color:#660">{</span><span style=3D"color:#000"><br>&n=
bsp; amalgam_ftor</span><span style=3D"color:#660">(</span><span sty=
le=3D"color:#000"> t </span><span style=3D"color:#660">...</span><span styl=
e=3D"color:#000"> </span><span style=3D"color:#008">in</span><span style=3D=
"color:#000"> </span><span style=3D"color:#660">)</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#660">:</span><span style=3D"color:#00=
0"> t</span><span style=3D"color:#660">(</span><span style=3D"color:#000"> =
std</span><span style=3D"color:#660">::</span><span style=3D"color:#000">mo=
ve</span><span style=3D"color:#660">(</span><span style=3D"color:#000"> </s=
pan><span style=3D"color:#008">in</span><span style=3D"color:#000"> </span>=
<span style=3D"color:#660">)</span><span style=3D"color:#000"> </span><span=
style=3D"color:#660">)</span><span style=3D"color:#000"> </span><span styl=
e=3D"color:#660">...</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">{}</span><span style=3D"color:#000"><br> </spa=
n><span style=3D"color:#008">using</span><span style=3D"color:#000"> t</spa=
n><span style=3D"color:#660">::</span><span style=3D"color:#008">operator</=
span><span style=3D"color:#000"> </span><span style=3D"color:#660">()</span=
><span style=3D"color:#000"> </span><span style=3D"color:#660">...</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#660">;</span><span s=
tyle=3D"color:#000"><br></span><span style=3D"color:#660">};</span><span st=
yle=3D"color:#000"><br></span></div></code></div><br>Is there any particula=
r obstacle to allowing this? Packs are allowed in many diverse contexts alr=
eady. The using declaration already must specify what kind of name exists i=
n the base (i.e. by the typename keyword), so there isn't room for confusio=
n.<br></blockquote><div><br>Currently (I think), all the places where `...`=
can unpack some construct are comma-delimited lists. So this would be rath=
er new, as you're basically unpacking a number of actual <i>statements</i>,=
rather than just expressions.<br></div>
<p></p>
-- <br />
<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_4513_28009094.1375959156114--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 8 Aug 2013 14:03:24 +0300
Raw View
--001a11c339e8609a4804e36d9ba4
Content-Type: text/plain; charset=ISO-8859-1
On 8 August 2013 13:52, Nicol Bolas <jmckesson@gmail.com> wrote:
> Currently (I think), all the places where `...` can unpack some construct
> are comma-delimited lists. So this would be rather new, as you're basically
> unpacking a number of actual *statements*, rather than just expressions.
>
>
>
>
There was an Evolution discussion over a year ago or so whether it would be
a good idea to allow expansions
like expr,... or statement;...
I don't recall the actual syntax at the moment, but the idea would be to be
able to expand expressions/statements
with a chosen delimiter. I guess
expr,...;
or some such would unpack the expression pack with commas in between and
finally add a semicolon.
There's been no proposal to push the idea further since that discussion.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--001a11c339e8609a4804e36d9ba4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 8 August 2013 13:52, Nicol Bolas <span dir=3D"ltr"><<a href=
=3D"mailto:jmckesson@gmail.com" target=3D"_blank">jmckesson@gmail.com</a>&g=
t;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Currently (I think), all the places where `.=
...` can unpack some construct are comma-delimited lists. So this would be r=
ather new, as you're basically unpacking a number of actual <i>statemen=
ts</i>, rather than just expressions.<br>
<div class=3D"HOEnZb"><div class=3D"h5">
<p></p>
<br><br></div></div></blockquote><div><br></div><div>There was an Evolution=
discussion over a year ago or so whether it would be a good idea to allow =
expansions<br></div><div>like expr,... or statement;...<br><br></div><div>
I don't recall the actual syntax at the moment, but the idea would be t=
o be able to expand expressions/statements<br>with a chosen delimiter. I gu=
ess<br>expr,...;<br></div><div>or some such would unpack the expression pac=
k with commas in between and finally add a semicolon.<br>
<br></div><div>There's been no proposal to push the idea further since =
that discussion.<br></div></div><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
<br />
<br />
--001a11c339e8609a4804e36d9ba4--
.
Author: David Krauss <potswa@gmail.com>
Date: Thu, 8 Aug 2013 16:55:25 -0700 (PDT)
Raw View
------=_Part_139_13834315.1376006125983
Content-Type: text/plain; charset=ISO-8859-1
This would be a member-declaration; it cannot be a statement. I have not
proposed anything that would be valid in block (local) scope. I'm thinking
of it more as a single using-declaration applied to the pack, than the pack
expanded to multiple declarations. Since all the items ("declarators") of
the expansion introduce the same name, it is a bit of a special case among
declarations.
For consistency, I suppose the language could also allow a
using-declaration to contain an explicit, comma-separated list of
qualified-ids, as long as they all introduce the same name:
struct foo : bar, baz {
using bar::zip, baz::zip; // OK, "declarators" have the same name and
same kind.
using bar::bar, baz::bar; // Error: different kinds.
using bar::dud, bar::fuzz; // Error: different names.
};
void fun() { // Commas could also work locally, but not pack expansions.
using ns1::pip, ns2::pip; // OK, extrapolating further.
using ns1::nip, ns1::tuck; // Error.
};
The restriction against naming the constructor in one "declarator" would
also apply to pack expansions.
It would probably be easier to specify this by also allowing inheriting
constructors from a pack, as noted by the extension DR.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_139_13834315.1376006125983
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">This would be a member-declaration; it cannot be a stateme=
nt. I have not=20
proposed anything that would be valid in block (local) scope. I'm=20
thinking of it more as a single using-declaration applied to the pack,=20
than the pack expanded to multiple declarations. Since all the items=20
("declarators") of the expansion introduce the same name, it is a bit of
a special case among declarations.<br><br>For consistency, I suppose=20
the language could also allow a using-declaration to contain an=20
explicit, comma-separated list of qualified-ids, as long as they all=20
introduce the same name:<br><br><div class=3D"prettyprint" style=3D"backgro=
und-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-sty=
le: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"pretty=
print"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"=
styled-by-prettify">struct</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> foo </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">:</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> bar</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> baz </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><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">using</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> bar</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">zip</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> baz</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">zip</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #800;" class=3D"styled-by-prettify">// OK, "declara=
tors" have the same name and same kind.</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br> </span><span style=3D"color:=
#008;" class=3D"styled-by-prettify">using</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> bar</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">bar</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> baz</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify">bar</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #800;" class=3D"styled-by-prettify">// Error: different kinds.</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br> </s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">using</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> bar</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">dud</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> bar</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify">fuzz</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: #800;" class=3D"styled-by-prettify">// Error: d=
ifferent names.</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><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">void</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> fun</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;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"sty=
led-by-prettify">// Commas could also work locally, but not pack expansions=
..</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br> =
; </span><span style=3D"color: #008;" class=3D"styled-by-prettify">u=
sing</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> ns1</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">pip</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> ns2</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">pip</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify">=
// OK, extrapolating further.</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br> </span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">using</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> ns1</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">nip</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> ns1</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">tuck</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;=
" class=3D"styled-by-prettify">// Error.</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">};</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br></span></div></code></div><br>The restriction against n=
aming the constructor in one "declarator" would also apply to pack expansio=
ns.<br><br>It would probably be easier to specify this by also allowing inh=
eriting constructors from a pack, as noted by the extension DR.</div>
<p></p>
-- <br />
<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
<br />
<br />
------=_Part_139_13834315.1376006125983--
.
Author: Alex B <devalexb@gmail.com>
Date: Thu, 8 Aug 2013 17:19:40 -0700 (PDT)
Raw View
------=_Part_7_29262528.1376007580906
Content-Type: text/plain; charset=ISO-8859-1
>
> For consistency, I suppose the language could also allow a
> using-declaration to contain an explicit, comma-separated list of
> qualified-ids, as long as they all introduce the same name:
>
>
Comma separated list in a using statement sounds like a nice idea to me; it
would indeed make pack expansions natural.
But why impose that they introduce the same name/kind?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_7_29262528.1376007580906
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><br>For consistency, I suppose=20
the language could also allow a using-declaration to contain an=20
explicit, comma-separated list of qualified-ids, as long as they all=20
introduce the same name:<br><br></div></blockquote><div><br></div><div>Comm=
a separated list in a using statement sounds like a nice idea to me; it wou=
ld indeed make pack expansions natural.</div><div><br></div><div>But why im=
pose that they introduce the same name/kind?</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
<br />
<br />
------=_Part_7_29262528.1376007580906--
.
Author: David Krauss <potswa@gmail.com>
Date: Thu, 8 Aug 2013 17:27:34 -0700 (PDT)
Raw View
------=_Part_76_10562974.1376008054668
Content-Type: text/plain; charset=ISO-8859-1
On Friday, August 9, 2013 8:19:40 AM UTC+8, Alex B wrote:
>
> Comma separated list in a using statement sounds like a nice idea to me;
> it would indeed make pack expansions natural.
>
> But why impose that they introduce the same name/kind?
>
Because declarations introducing many names are poor style. One declaration
introducing different kinds would be confusing; aside from something like
"int i, j( long ) noexcept;" which declares an object and a function, and
is an abomination, we don't have such things for a good reason. I wouldn't
make such a suggestion except for consistency with the pack expansion
feature I want.
But introducing things with the same name and kind on one line is a good
thing because they overload and the declarations should be grouped. (Since
types cannot overload, this imposes that the only kinds allowed are
functions and perhaps function templates; see my other topic thread.)
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_76_10562974.1376008054668
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Friday, August 9, 2013 8:19:40 AM UTC+8, Alex B wrote:<=
blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bord=
er-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">Comma separate=
d list in a using statement sounds like a nice idea to me; it would indeed =
make pack expansions natural.<div><br></div><div>But why impose that they i=
ntroduce the same name/kind?</div></div></blockquote><div><br>Because decla=
rations introducing many names are poor style. One declaration introducing =
different kinds would be confusing; aside from something like "int i, j( lo=
ng ) noexcept;" which declares an object and a function, and is an abominat=
ion, we don't have such things for a good reason. I wouldn't make such a su=
ggestion except for consistency with the pack expansion feature I want.<br>=
<br>But introducing things with the same name and kind on one line is a goo=
d thing because they overload and the declarations should be grouped. (Sinc=
e types cannot overload, this imposes that the only kinds allowed are funct=
ions and perhaps function templates; see my other topic thread.)<br></div><=
/div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
<br />
<br />
------=_Part_76_10562974.1376008054668--
.