Topic: Uniform initialization is too restrictive with


Author: stackmachine@hotmail.com
Date: Sat, 15 Dec 2012 05:50:03 -0800 (PST)
Raw View
------=_Part_25_20106670.1355579403365
Content-Type: text/plain; charset=ISO-8859-1

It has often occured to me that I have a function returning a
std::unique_ptr. Naturally, I would expect this to work:
struct foo {};

std::unique_ptr<foo> bar(bool baz)
{
    if(baz)
        return {};

    return { new foo };
}
The problem is the foo* constructor here, because it is explicit (for very
good reasons). What I have to write instead is the following:
return std::unique_ptr<foo>{ new foo };
It's not much better with a make_unique facility.

The same problem applies to std::tuple too.
void foo(std::tuple<int, double, std::string>);

foo({ 42, 3.14, "Hello, World" }); // error
foo(std::tuple<int, double, std::string>{ 42, 3.14, "Hello, World" }); //
works, but eww
foo(make_tuple(42, 3.14, "Hello, World")); // works, but i didn't use it
for type deduction, which is against its intent
I think the {}-syntax is already explicit enough, therefore it should allow
calling explicit constructors without the type. Is there anything I have
missed?

--




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

It has often occured to me that I have a function returning a std::unique_p=
tr. Naturally, I would expect this to work:<code><br></code><div class=3D"p=
rettyprint" style=3D"background-color: rgb(250, 250, 250); border-color: rg=
b(187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-=
word;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><code><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> foo </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">{};</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br><br>std</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify">unique_ptr</span><span style=3D"color: #08=
0;" class=3D"styled-by-prettify">&lt;foo&gt;</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> bar</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">bool</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> baz</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></span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp;=
 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">if</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">baz</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; &nbsp; &nbsp; </span><sp=
an style=3D"color: #008;" class=3D"styled-by-prettify">return</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"><br><br>&nbsp; &nbsp; </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">return</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"> </span><span style=3D"color: #008;" class=3D"styl=
ed-by-prettify">new</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> foo </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></=
code></div></code></div>The
 problem is the foo* constructor here, because it is explicit (for very=20
good reasons). What I have to write instead is the following:<br><div class=
=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); border-colo=
r: rgb(187, 187, 187); border-style: solid; border-width: 1px; word-wrap: b=
reak-word;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><code=
 class=3D"prettyprint"><code><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">return</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">s=
td::unique_ptr&lt;foo&gt;{</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">new</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 foo </span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></=
code></code></div></code></div>It's not much better with a make_unique faci=
lity.<br><br>The same problem applies to std::tuple too.<br><div class=3D"p=
rettyprint" style=3D"background-color: rgb(250, 250, 250); border-color: rg=
b(187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-=
word;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span styl=
e=3D"color: #606;" class=3D"styled-by-prettify"></span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">void foo(std::tuple&lt;int, double, s=
td::string&gt;);<br><br>foo({ 42, 3.14, "Hello, World" }); // error<br>foo(=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify"><code clas=
s=3D"prettyprint"><span class=3D"styled-by-prettify">std::tuple&lt;int, dou=
ble, std::string&gt;</span></code>{</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify"><code class=3D"prettyprint"><span class=3D"styled-=
by-prettify"> 42, 3.14, "Hello, World" </span></code>}); // works, but eww<=
br>foo(make_tuple(</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify"><code class=3D"prettyprint"><span class=3D"styled-by-prettify">42, =
3.14, "Hello, World"</span></code>)); // works, but i didn't use it for typ=
e deduction, which is against its intent<br></span></div></code></div>I
 think the {}-syntax is already explicit enough, therefore it should=20
allow calling explicit constructors without the type. Is there anything I
 have missed?<br>

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_25_20106670.1355579403365--

.


Author: "R. Martinho Fernandes" <martinho.fernandes@gmail.com>
Date: Sat, 15 Dec 2012 06:02:55 -0800 (PST)
Raw View
------=_Part_59_15097767.1355580175706
Content-Type: text/plain; charset=ISO-8859-1

I have once before asked about this on Stack Overflow
http://stackoverflow.com/questions/9157041/what-could-go-wrong-if-copy-list-initialization-allowed-explicit-constructors.
I would really like to get rid of this nuissance.

On Saturday, December 15, 2012 2:50:03 PM UTC+1, stackm...@hotmail.com
wrote:
>
> It has often occured to me that I have a function returning a
> std::unique_ptr. Naturally, I would expect this to work:
> struct foo {};
>
> std::unique_ptr<foo> bar(bool baz)
> {
>     if(baz)
>         return {};
>
>     return { new foo };
> }
> The problem is the foo* constructor here, because it is explicit (for very
> good reasons). What I have to write instead is the following:
> return std::unique_ptr<foo>{ new foo };
> It's not much better with a make_unique facility.
>
> The same problem applies to std::tuple too.
> void foo(std::tuple<int, double, std::string>);
>
> foo({ 42, 3.14, "Hello, World" }); // error
> foo(std::tuple<int, double, std::string>{ 42, 3.14, "Hello, World" }); //
> works, but eww
> foo(make_tuple(42, 3.14, "Hello, World")); // works, but i didn't use it
> for type deduction, which is against its intent
> I think the {}-syntax is already explicit enough, therefore it should
> allow calling explicit constructors without the type. Is there anything I
> have missed?
>

--




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

I have once before asked about this on Stack Overflow http://stackoverflow.=
com/questions/9157041/what-could-go-wrong-if-copy-list-initialization-allow=
ed-explicit-constructors. I would really like to get rid of this nuissance.=
<br><br>On Saturday, December 15, 2012 2:50:03 PM UTC+1, stackm...@hotmail.=
com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">It has often occured=
 to me that I have a function returning a std::unique_ptr. Naturally, I wou=
ld expect this to work:<code><br></code><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><code><span style=3D"color:#008">struc=
t</span><span style=3D"color:#000"> foo </span><span style=3D"color:#660">{=
};</span><span style=3D"color:#000"><br><br>std</span><span style=3D"color:=
#660">::</span><span style=3D"color:#000">unique_ptr</span><span style=3D"c=
olor:#080">&lt;foo&gt;</span><span style=3D"color:#000"> bar</span><span st=
yle=3D"color:#660">(</span><span style=3D"color:#008">bool</span><span styl=
e=3D"color:#000"> baz</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>&nbsp; &nbsp; </span><span style=3D"color:#008">if</spa=
n><span style=3D"color:#660">(</span><span style=3D"color:#000">baz</span><=
span style=3D"color:#660">)</span><span style=3D"color:#000"><br>&nbsp; &nb=
sp; &nbsp; &nbsp; </span><span style=3D"color:#008">return</span><span styl=
e=3D"color:#000"> </span><span style=3D"color:#660">{};</span><span style=
=3D"color:#000"><br><br>&nbsp; &nbsp; </span><span style=3D"color:#008">ret=
urn</span><span style=3D"color:#000"> </span><span style=3D"color:#660">{</=
span><span style=3D"color:#000"> </span><span style=3D"color:#008">new</spa=
n><span style=3D"color:#000"> foo </span><span style=3D"color:#660">};</spa=
n><span style=3D"color:#000"><br></span><span style=3D"color:#660">}</span>=
</code></div></code></div>The
 problem is the foo* constructor here, because it is explicit (for very=20
good reasons). What I have to write instead is the following:<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><code><code><=
span style=3D"color:#008">return</span><span style=3D"color:#000"> </span><=
span style=3D"color:#660">std::unique_ptr&lt;foo&gt;{</span><span style=3D"=
color:#000"> </span><span style=3D"color:#008">new</span><span style=3D"col=
or:#000"> foo </span><span style=3D"color:#660">};</span><span style=3D"col=
or:#000"><br></span></code></code></div></code></div>It's not much better w=
ith a make_unique facility.<br><br>The same problem applies to std::tuple t=
oo.<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:#606"></span><span style=3D"color:#660">void foo(s=
td::tuple&lt;int, double, std::string&gt;);<br><br>foo({ 42, 3.14, "Hello, =
World" }); // error<br>foo(</span><span style=3D"color:#660"><code><span>st=
d::tuple&lt;int, double, std::string&gt;</span></code>{</span><span style=
=3D"color:#660"><code><span> 42, 3.14, "Hello, World" </span></code>}); // =
works, but eww<br>foo(make_tuple(</span><span style=3D"color:#660"><code><s=
pan>42, 3.14, "Hello, World"</span></code>)); // works, but i didn't use it=
 for type deduction, which is against its intent<br></span></div></code></d=
iv>I
 think the {}-syntax is already explicit enough, therefore it should=20
allow calling explicit constructors without the type. Is there anything I
 have missed?<br></blockquote>

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_59_15097767.1355580175706--

.


Author: John Bytheway <jbytheway@gmail.com>
Date: Sat, 15 Dec 2012 10:10:50 -0500
Raw View
On 15/12/12 08:50, stackmachine@hotmail.com wrote:
> It has often occured to me that I have a function returning a
> std::unique_ptr. Naturally, I would expect this to work:|
> |
> ||
> |structfoo {};
>
> std::unique_ptr<foo>bar(boolbaz)
> {
>     if(baz)
>         return{};
>
>     return{newfoo };
> }|
> The problem is the foo* constructor here, because it is explicit (for
> very good reasons). What I have to write instead is the following:
> ||
> ||returnstd::unique_ptr<foo>{newfoo };
> ||
> It's not much better with a make_unique facility.
>
> The same problem applies to std::tuple too.
> ||
> void foo(std::tuple<int, double, std::string>);
>
> foo({ 42, 3.14, "Hello, World" }); // error
> foo(|std::tuple<int, double, std::string>|{|42, 3.14, "Hello, World"
> |}); // works, but eww
> foo(make_tuple(|42, 3.14, "Hello, World"|)); // works, but i didn't use
> it for type deduction, which is against its intent

Concur.  These two cases in particular (unique_ptr and tuple) have vexed
me on several occasions.

> I think the {}-syntax is already explicit enough, therefore it should
> allow calling explicit constructors without the type. Is there anything
> I have missed?

The most recent document I can find on this topic with rationale is
N2352
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2532.pdf>.
However, this appears to explicitly state that the above style of
construct should be valid.  I guess something changed after that.  Can
anyone point to a more recent document?

I think the only way to fix this without it being a breaking change is
to introduce another keyword to allow explicit constructor to opt back
in to copy-list-initialization.  e.g.

  explicit listinit unique_ptr(pointer p) noexcept;

This is moderately ugly, but I could live with it.

(Note that this is only not a breaking change at the language level.  If
we change standard library constructors (which of course we must to
avoid the above issues) then we risk breaking code)

However, my preference would be to simply scrap the clause and allow all
constructors in copy-list-initialization.  I have not yet seen a
compelling argument against this route.

In either case, I think that there would be very few breakages.

John Bytheway

--




.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Sat, 15 Dec 2012 17:16:52 +0200
Raw View
On 15 December 2012 17:10, John Bytheway <jbytheway@gmail.com> wrote:
> Concur.  These two cases in particular (unique_ptr and tuple) have vexed
> me on several occasions.
>> I think the {}-syntax is already explicit enough, therefore it should
>> allow calling explicit constructors without the type. Is there anything
>> I have missed?
> The most recent document I can find on this topic with rationale is
> N2352
> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2532.pdf>.
> However, this appears to explicitly state that the above style of
> construct should be valid.  I guess something changed after that.  Can
> anyone point to a more recent document?

There was a discussion about this issue in the Portland, and there was
significant resistance to making a change. The proposal paper was late,
and didn't appear in any mailing, and the proposal author afaik is not
going to pursue the idea further, because it was rejected in the EWG.

--




.


Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Sat, 15 Dec 2012 16:31:24 +0100
Raw View
This is a multi-part message in MIME format.
--------------070203050207060707000102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Le 15/12/12 14:50, stackmachine@hotmail.com a =E9crit :
> It has often occured to me that I have a function returning a=20
> std::unique_ptr. Naturally, I would expect this to work:|
> |
> |
> |structfoo {};
>
> std::unique_ptr<foo>bar(boolbaz)
> {
> if(baz)
> return{};
>
> return{newfoo };
> }|
> |
> The problem is the foo* constructor here, because it is explicit (for=20
> very good reasons). What I have to write instead is the following:
> |
> ||returnstd::unique_ptr<foo>{newfoo };
> ||
> |
> It's not much better with a make_unique facility.
>
> The same problem applies to std::tuple too.
> |
> void foo(std::tuple<int, double, std::string>);
>
> foo({ 42, 3.14, "Hello, World" }); // error
> foo(|std::tuple<int, double, std::string>|{|42, 3.14, "Hello, World"=20
> |}); // works, but eww
> foo(make_tuple(|42, 3.14, "Hello, World"|)); // works, but i didn't=20
> use it for type deduction, which is against its intent
> |
> I think the {}-syntax is already explicit enough, therefore it should=20
> allow calling explicit constructors without the type. Is there=20
> anything I have missed?
>
>
>
It depends on what do you consider enough explicit. The language request=20
the type when a explicit constructor is required. {}-syntax builds a=20
initializer-list that can be used as parameter of a function/constructor=20
but not which one. Of course in the return context the function return=20
type could be the 'implicit' type used to call the explicit constructor.
IMO, the implicit type should be a little bit more explicit, e.g using=20
auto or explicit

||returnauto({newfoo });
||or
||returnexplicit({newfoo });
||

An alternative could be to declare an implicit unique_ptr constructor=20
from an initializer list.

Another alternative is to build a new type that is implicitly=20
convertible to any type

||returnimplicit(newfoo);
||
template <typename T>
class implicitly_convertible {
   T value;
public:
   implicitly_convertible(T val) : value(val) {}
   template <typename U>
   operator U() { return U(value); }
};

template <typename T>
implicitly_convertible<T> implicit(T value) { return=20
implicitly_convertible<T>(value); }

Vicente

--=20




--------------070203050207060707000102
Content-Type: text/html; charset=ISO-8859-1

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Le 15/12/12 14:50,
      <a class="moz-txt-link-abbreviated" href="mailto:stackmachine@hotmail.com">stackmachine@hotmail.com</a> a &eacute;crit&nbsp;:<br>
    </div>
    <blockquote
      cite="mid:af1795dd-159d-435b-85a6-0048a3dc42ed@isocpp.org"
      type="cite">It has often occured to me that I have a function
      returning a std::unique_ptr. Naturally, I would expect this to
      work:<code><br>
      </code>
      <div class="prettyprint" style="background-color: rgb(250, 250,
        250); border-color: rgb(187, 187, 187); border-style: solid;
        border-width: 1px; word-wrap: break-word;"><code
          class="prettyprint">
          <div class="subprettyprint"><code><span style="color: #008;"
                class="styled-by-prettify">struct</span><span
                style="color: #000;" class="styled-by-prettify"> foo </span><span
                style="color: #660;" class="styled-by-prettify">{};</span><span
                style="color: #000;" class="styled-by-prettify"><br>
                <br>
                std</span><span style="color: #660;"
                class="styled-by-prettify">::</span><span style="color:
                #000;" class="styled-by-prettify">unique_ptr</span><span
                style="color: #080;" class="styled-by-prettify">&lt;foo&gt;</span><span
                style="color: #000;" class="styled-by-prettify"> bar</span><span
                style="color: #660;" class="styled-by-prettify">(</span><span
                style="color: #008;" class="styled-by-prettify">bool</span><span
                style="color: #000;" class="styled-by-prettify"> baz</span><span
                style="color: #660;" class="styled-by-prettify">)</span><span
                style="color: #000;" class="styled-by-prettify"><br>
              </span><span style="color: #660;"
                class="styled-by-prettify">{</span><span style="color:
                #000;" class="styled-by-prettify"><br>
                &nbsp; &nbsp; </span><span style="color: #008;"
                class="styled-by-prettify">if</span><span style="color:
                #660;" class="styled-by-prettify">(</span><span
                style="color: #000;" class="styled-by-prettify">baz</span><span
                style="color: #660;" class="styled-by-prettify">)</span><span
                style="color: #000;" class="styled-by-prettify"><br>
                &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #008;"
                class="styled-by-prettify">return</span><span
                style="color: #000;" class="styled-by-prettify"> </span><span
                style="color: #660;" class="styled-by-prettify">{};</span><span
                style="color: #000;" class="styled-by-prettify"><br>
                <br>
                &nbsp; &nbsp; </span><span style="color: #008;"
                class="styled-by-prettify">return</span><span
                style="color: #000;" class="styled-by-prettify"> </span><span
                style="color: #660;" class="styled-by-prettify">{</span><span
                style="color: #000;" class="styled-by-prettify"> </span><span
                style="color: #008;" class="styled-by-prettify">new</span><span
                style="color: #000;" class="styled-by-prettify"> foo </span><span
                style="color: #660;" class="styled-by-prettify">};</span><span
                style="color: #000;" class="styled-by-prettify"><br>
              </span><span style="color: #660;"
                class="styled-by-prettify">}</span></code></div>
        </code></div>
      The problem is the foo* constructor here, because it is explicit
      (for very good reasons). What I have to write instead is the
      following:<br>
      <div class="prettyprint" style="background-color: rgb(250, 250,
        250); border-color: rgb(187, 187, 187); border-style: solid;
        border-width: 1px; word-wrap: break-word;"><code
          class="prettyprint">
          <div class="subprettyprint"><code class="prettyprint"><code><span
                  style="color: #008;" class="styled-by-prettify">return</span><span
                  style="color: #000;" class="styled-by-prettify"> </span><span
                  style="color: #660;" class="styled-by-prettify">std::unique_ptr&lt;foo&gt;{</span><span
                  style="color: #000;" class="styled-by-prettify"> </span><span
                  style="color: #008;" class="styled-by-prettify">new</span><span
                  style="color: #000;" class="styled-by-prettify"> foo </span><span
                  style="color: #660;" class="styled-by-prettify">};</span><span
                  style="color: #000;" class="styled-by-prettify"><br>
                </span></code></code></div>
        </code></div>
      It's not much better with a make_unique facility.<br>
      <br>
      The same problem applies to std::tuple too.<br>
      <div class="prettyprint" style="background-color: rgb(250, 250,
        250); border-color: rgb(187, 187, 187); border-style: solid;
        border-width: 1px; word-wrap: break-word;"><code
          class="prettyprint">
          <div class="subprettyprint"><span style="color: #606;"
              class="styled-by-prettify"></span><span style="color:
              #660;" class="styled-by-prettify">void
              foo(std::tuple&lt;int, double, std::string&gt;);<br>
              <br>
              foo({ 42, 3.14, "Hello, World" }); // error<br>
              foo(</span><span style="color: #660;"
              class="styled-by-prettify"><code class="prettyprint"><span
                  class="styled-by-prettify">std::tuple&lt;int, double,
                  std::string&gt;</span></code>{</span><span
              style="color: #660;" class="styled-by-prettify"><code
                class="prettyprint"><span class="styled-by-prettify">
                  42, 3.14, "Hello, World" </span></code>}); // works,
              but eww<br>
              foo(make_tuple(</span><span style="color: #660;"
              class="styled-by-prettify"><code class="prettyprint"><span
                  class="styled-by-prettify">42, 3.14, "Hello, World"</span></code>));
              // works, but i didn't use it for type deduction, which is
              against its intent<br>
            </span></div>
        </code></div>
      I think the {}-syntax is already explicit enough, therefore it
      should allow calling explicit constructors without the type. Is
      there anything I have missed?<br>
      &nbsp;
      <br>
      &nbsp;<br>
      &nbsp;<br>
    </blockquote>
    It depends on what do you consider enough explicit. The language
    request the type when a explicit constructor is required. {}-syntax
    builds a initializer-list that can be used as parameter of a
    function/constructor but not which one. Of course in the return
    context the function return type could be the 'implicit' type used
    to call the explicit constructor.<br>
    IMO, the implicit type should be a little bit more explicit, e.g
    using auto or explicit<br>
    <br>
    <code class="prettyprint"><code><span style="color: #000;"
          class="styled-by-prettify">&nbsp; &nbsp; </span><span style="color:
          #008;" class="styled-by-prettify">return</span><span
          style="color: #000;" class="styled-by-prettify"> auto(</span><span
          style="color: #660;" class="styled-by-prettify">{</span><span
          style="color: #000;" class="styled-by-prettify"> </span><span
          style="color: #008;" class="styled-by-prettify">new</span><span
          style="color: #000;" class="styled-by-prettify"> foo </span><span
          style="color: #660;" class="styled-by-prettify">});</span><span
          style="color: #000;" class="styled-by-prettify"><br>
        </span><span style="color: #660;" class="styled-by-prettify"></span></code></code>or<br>
    <code class="prettyprint"><code><span style="color: #000;"
          class="styled-by-prettify">&nbsp; &nbsp; </span><span style="color:
          #008;" class="styled-by-prettify">return</span><span
          style="color: #000;" class="styled-by-prettify"> explicit(</span><span
          style="color: #660;" class="styled-by-prettify">{</span><span
          style="color: #000;" class="styled-by-prettify"> </span><span
          style="color: #008;" class="styled-by-prettify">new</span><span
          style="color: #000;" class="styled-by-prettify"> foo </span><span
          style="color: #660;" class="styled-by-prettify">});</span><span
          style="color: #000;" class="styled-by-prettify"><br>
        </span><span style="color: #660;" class="styled-by-prettify"></span></code></code><br>
    <br>
    An alternative could be to declare an implicit unique_ptr
    constructor from an initializer list.<br>
    <br>
    Another alternative is to build a new type that is implicitly
    convertible to any type<br>
    <br>
    <code class="prettyprint"><code><span style="color: #000;"
          class="styled-by-prettify">&nbsp; &nbsp; </span><span style="color:
          #008;" class="styled-by-prettify">return</span><span
          style="color: #000;" class="styled-by-prettify"> implicit(</span><span
          style="color: #000;" class="styled-by-prettify"></span><span
          style="color: #008;" class="styled-by-prettify">new</span><span
          style="color: #000;" class="styled-by-prettify"> foo</span><span
          style="color: #660;" class="styled-by-prettify">);</span><span
          style="color: #000;" class="styled-by-prettify"><br>
        </span><span style="color: #660;" class="styled-by-prettify"></span></code></code><br>
    template &lt;typename T&gt;<br>
    class implicitly_convertible {<br>
    &nbsp; T value;<br>
    public: <br>
    &nbsp; implicitly_convertible(T val) : value(val) {}<br>
    &nbsp; template &lt;typename U&gt;<br>
    &nbsp; operator U() { return U(value); }<br>
    };<br>
    <br>
    template &lt;typename T&gt;<br>
    implicitly_convertible&lt;T&gt; implicit(T value) { return
    implicitly_convertible&lt;T&gt;(value); }<br>
    &nbsp;<br>
    Vicente<br>
  </body>
</html>

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

--------------070203050207060707000102--

.


Author: DeadMG <wolfeinstein@gmail.com>
Date: Sat, 15 Dec 2012 12:39:23 -0800 (PST)
Raw View
------=_Part_215_30713667.1355603963599
Content-Type: text/plain; charset=ISO-8859-1

I agree. When you have {} in an expression, it's pretty explicit that you
are constructing a new object of some type, with the arguments inside the
braces. I think that explicit constructors should be available for use. The
possible impact on legacy code, though, I am uncertain.

--




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

I agree. When you have {} in an expression, it's pretty explicit that you a=
re constructing a new object of some type, with the arguments inside the br=
aces. I think that explicit constructors should be available for use. The p=
ossible impact on legacy code, though, I am uncertain.

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_215_30713667.1355603963599--

.


Author: Fernando Pelliccioni <fpelliccioni@gmail.com>
Date: Sun, 16 Dec 2012 14:23:09 -0300
Raw View
--14dae939983fc5638204d0fb84e9
Content-Type: text/plain; charset=ISO-8859-1

On Sat, Dec 15, 2012 at 5:39 PM, DeadMG <wolfeinstein@gmail.com> wrote:

> I agree. When you have {} in an expression, it's pretty explicit that you
> are constructing a new object of some type, with the arguments inside the
> braces. I think that explicit constructors should be available for use. The
> possible impact on legacy code, though, I am uncertain.
>
> --
>

Here another similar discussion I posted some time ago.

https://groups.google.com/a/isocpp.org/d/topic/std-discussion/1J0Ik9Q1noU/discussion

It had little impact at the forum...
I think the standard should be changed to support the examples presented.

I have no experience in making proposals, but if we create a team, I
volunteer to work at it.

--




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

<div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Sat, Dec 15, 2=
012 at 5:39 PM, DeadMG <span dir=3D"ltr">&lt;<a href=3D"mailto:wolfeinstein=
@gmail.com" target=3D"_blank">wolfeinstein@gmail.com</a>&gt;</span> wrote:<=
br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:soli=
d;padding-left:1ex">
I agree. When you have {} in an expression, it&#39;s pretty explicit that y=
ou are constructing a new object of some type, with the arguments inside th=
e braces. I think that explicit constructors should be available for use. T=
he possible impact on legacy code, though, I am uncertain.

<span class=3D""><font color=3D"#888888"><p></p>

-- <br></font></span></blockquote><div><br></div><div>Here another similar =
discussion I posted some time ago.</div><div><br></div><div><a href=3D"http=
s://groups.google.com/a/isocpp.org/d/topic/std-discussion/1J0Ik9Q1noU/discu=
ssion">https://groups.google.com/a/isocpp.org/d/topic/std-discussion/1J0Ik9=
Q1noU/discussion</a></div>
<div><br></div><div>It had little impact at the forum...</div><div>I think =
the standard should be changed to support the examples presented.</div><div=
><br></div><div>I have no experience in making proposals, but if we create =
a team, I volunteer to work at it.=A0</div>
<div><br></div><div><br></div></div></div>

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

--14dae939983fc5638204d0fb84e9--

.


Author: Sebastian Gesemann <s.gesemann@gmail.com>
Date: Mon, 17 Dec 2012 18:04:45 +0100
Raw View
On Sat, Dec 15, 2012 at 2:50 PM,  stackmachine wrote:
> It has often occured to me that I have a function returning a
> std::unique_ptr. Naturally, I would expect this to work:
> struct foo {};
>
> std::unique_ptr<foo> bar(bool baz)
> {
>     if(baz)
>         return {};
>     return { new foo };
> }
>
> The problem is the foo* constructor here, because it is explicit (for very
> good reasons). What I have to write instead is the following:
> return std::unique_ptr<foo>{ new foo };
> It's not much better with a make_unique facility.

I agree.

> The same problem applies to std::tuple too.
> void foo(std::tuple<int, double, std::string>);
>
> foo({ 42, 3.14, "Hello, World" }); // error

Wow. This is an error? I did not expect the corresponding tuple
constructor to be explicit. Why is it explicit in the first place?!

> I think the {}-syntax is already explicit enough, therefore it should allow
> calling explicit constructors without the type. Is there anything I have
> missed?

I'm not convinced that it's a good idea to allow _any_ kind of {}
initialization to also pick an explicit constructor. We have two
classes of initialization: direct-initialization (which has access to
explicit constructors) and copy-initialization (which has only access
to implicit constructors. This is also the case for list
initialization: direct-list-initialization, copy-list-initialization
and I think it should stay that way simply because you can exploit
explicit constructors to avoid accidental conversions during overload
resulution and such.

The return statement is said to copy-initialize the return value.
Maybe, it's a good idea to say that "returning a list" is considered a
direct-list-initialization. In this case (returning a list) I really
don't see the harm in treating this as direct-list-initialization.
It's not like we could pick the wrong overload. There is just one
target type and it's the function's declared return-type. I don't see
how any "accidental conversion" could happen here.

--




.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon, 17 Dec 2012 19:19:05 +0200
Raw View
On 17 December 2012 19:04, Sebastian Gesemann <s.gesemann@gmail.com> wrote:
> The return statement is said to copy-initialize the return value.
> Maybe, it's a good idea to say that "returning a list" is considered a
> direct-list-initialization. In this case (returning a list) I really
> don't see the harm in treating this as direct-list-initialization.
> It's not like we could pick the wrong overload. There is just one
> target type and it's the function's declared return-type. I don't see
> how any "accidental conversion" could happen here.

All of these points, including the one-target-type were presented by
Herb in Portland,
aka the last meeting. Unfortunately he hasn't released his paper, it
would be good for
the sake of having a paper trail. Anyway, the EWG wasn't convinced by
these arguments.
My take on it is that

return {new Foo};

may be "explicit" enough, but what about

return {p};

where p is what-ever pointer, or a member that is a pointer? I don't
consider that explicit
enough, and I don't want to even think about making a special rule for
any new-expressions
or rvalues or anything like that. The tuple case has an open library issue, see
http://open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3473.html#2051
(you may recognize the issue submitter, although it's from one of my
constituents, I just
reported it), but for unique_ptr I don't think we should go towards
the direction of making
ownership transfer any more implicit than it is, and the same applies
to shared_ptr as far
as I am concerned.

--




.


Author: Olaf van der Spek <olafvdspek@gmail.com>
Date: Mon, 17 Dec 2012 10:56:23 -0800 (PST)
Raw View
------=_Part_35_4188943.1355770583898
Content-Type: text/plain; charset=ISO-8859-1

On Saturday, December 15, 2012 2:50:03 PM UTC+1, stackm...@hotmail.com
wrote:

> The problem is the foo* constructor here, because it is explicit (for very
> good reasons). What I have to write instead is the following:
> return std::unique_ptr<foo>{ new foo };
> It's not much better with a make_unique facility.
>
> How so?
return std::make_unique<foo> is simpler;

--




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

On Saturday, December 15, 2012 2:50:03 PM UTC+1, stackm...@hotmail.com wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8=
ex;border-left: 1px #ccc solid;padding-left: 1ex;">The
 problem is the foo* constructor here, because it is explicit (for very=20
good reasons). What I have to write instead is the following:<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><code><code><=
span style=3D"color:#008">return</span><span style=3D"color:#000"> </span><=
span style=3D"color:#660">std::unique_ptr&lt;foo&gt;{</span><span style=3D"=
color:#000"> </span><span style=3D"color:#008">new</span><span style=3D"col=
or:#000"> foo </span><span style=3D"color:#660">};</span><span style=3D"col=
or:#000"><br></span></code></code></div></code></div>It's not much better w=
ith a make_unique facility.<br><br></blockquote><div>How so?</div><div>retu=
rn std::make_unique&lt;foo&gt; is simpler;</div><div><br></div>

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_35_4188943.1355770583898--

.


Author: stackmachine@hotmail.com
Date: Mon, 17 Dec 2012 11:35:15 -0800 (PST)
Raw View
------=_Part_378_10620655.1355772915205
Content-Type: text/plain; charset=ISO-8859-1



Am Montag, 17. Dezember 2012 19:56:23 UTC+1 schrieb Olaf van der Spek:
>
> On Saturday, December 15, 2012 2:50:03 PM UTC+1, stackm...@hotmail.comwrote:
>
>> The problem is the foo* constructor here, because it is explicit (for
>> very good reasons). What I have to write instead is the following:
>> return std::unique_ptr<foo>{ new foo };
>> It's not much better with a make_unique facility.
>>
>> How so?
> return std::make_unique<foo> is simpler;
>
> It is just ugly, compared to { new foo }.

--




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

<br><br>Am Montag, 17. Dezember 2012 19:56:23 UTC+1 schrieb Olaf van der Sp=
ek:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;=
border-left: 1px #ccc solid;padding-left: 1ex;">On Saturday, December 15, 2=
012 2:50:03 PM UTC+1, <a>stackm...@hotmail.com</a> wrote:<br><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #cc=
c solid;padding-left:1ex">The
 problem is the foo* constructor here, because it is explicit (for very=20
good reasons). What I have to write instead is the following:<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><code><code><=
span style=3D"color:#008">return</span><span style=3D"color:#000"> </span><=
span style=3D"color:#660">std::unique_ptr&lt;foo&gt;{</span><span style=3D"=
color:#000"> </span><span style=3D"color:#008">new</span><span style=3D"col=
or:#000"> foo </span><span style=3D"color:#660">};</span><span style=3D"col=
or:#000"><br></span></code></code></div></code></div>It's not much better w=
ith a make_unique facility.<br><br></blockquote><div>How so?</div><div>retu=
rn std::make_unique&lt;foo&gt; is simpler;</div><div><br></div></blockquote=
><div>It is just ugly, compared to { new foo }. <br></div>

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_378_10620655.1355772915205--

.


Author: DeadMG <wolfeinstein@gmail.com>
Date: Mon, 17 Dec 2012 12:42:04 -0800 (PST)
Raw View
------=_Part_275_12016267.1355776924439
Content-Type: text/plain; charset=ISO-8859-1

I think that for passing arguments, it is not so bad, because then you have
overload resolution and such. However, when you are returning, there is
only one type possibly under consideration, and it's quite explicit that
you are constructing that type. Having to specify the return type again is
just unnecessary code duplication.

--




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

I think that for passing arguments, it is not so bad, because then you have=
 overload resolution and such. However, when you are returning, there is on=
ly one type possibly under consideration, and it's quite explicit that you =
are constructing that type. Having to specify the return type again is just=
 unnecessary code duplication.

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_275_12016267.1355776924439--

.


Author: Arthur Tchaikovsky <atch.cpp@gmail.com>
Date: Tue, 18 Dec 2012 09:10:39 -0800 (PST)
Raw View
------=_Part_1382_10969448.1355850639932
Content-Type: text/plain; charset=ISO-8859-1

Hi,
In one of your examples from:
https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/1J0Ik9Q1noU/discussion
you are incorrect when you state:
 struct like_std_string
{
  template<class InputIterator>
  like_std_string(InputIterator begin, InputIterator end);      // This is
a converting constructor.
};

The point is that "like_std_string(InputIterator begin, InputIterator
end);" is not a converting constructor
Regards

On Saturday, 15 December 2012 13:50:03 UTC, stackm...@hotmail.com wrote:

> It has often occured to me that I have a function returning a
> std::unique_ptr. Naturally, I would expect this to work:
>  struct foo {};
>
> std::unique_ptr<foo> bar(bool baz)
> {
>     if(baz)
>         return {};
>
>     return { new foo };
> }
> The problem is the foo* constructor here, because it is explicit (for very
> good reasons). What I have to write instead is the following:
>  return std::unique_ptr<foo>{ new foo };
> It's not much better with a make_unique facility.
>
> The same problem applies to std::tuple too.
>  void foo(std::tuple<int, double, std::string>);
>
> foo({ 42, 3.14, "Hello, World" }); // error
> foo(std::tuple<int, double, std::string>{ 42, 3.14, "Hello, World" }); //
> works, but eww
> foo(make_tuple(42, 3.14, "Hello, World")); // works, but i didn't use it
> for type deduction, which is against its intent
> I think the {}-syntax is already explicit enough, therefore it should
> allow calling explicit constructors without the type. Is there anything I
> have missed?
>

--




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

<DIV>Hi,</DIV>
<DIV>In one of your examples from: <A href=3D"https://groups.google.com/a/i=
socpp.org/forum/#!topic/std-discussion/1J0Ik9Q1noU/discussion">https://grou=
ps.google.com/a/isocpp.org/forum/#!topic/std-discussion/1J0Ik9Q1noU/discuss=
ion</A></DIV>
<DIV>you are incorrect when you state:</DIV>
<DIV>
<DIV><FONT face=3D"'courier new', monospace">struct like_std_string</FONT><=
/DIV>
<DIV><FONT face=3D"'courier new', monospace">{</FONT></DIV>
<DIV><FONT face=3D"'courier new', monospace">&nbsp; template&lt;class Input=
Iterator&gt;</FONT></DIV>
<DIV><FONT face=3D"'courier new', monospace">&nbsp; like_std_string(InputIt=
erator begin, InputIterator end); &nbsp; &nbsp; &nbsp;// This is a converti=
ng constructor.</FONT></DIV>
<DIV><FONT face=3D"'courier new', monospace">};</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>The point is that "like_std_string(InputIterator begin, InputIterator =
end);" is not a converting constructor</DIV>
<DIV>Regards</DIV>
<DIV><BR>On Saturday, 15 December 2012 13:50:03 UTC, stackm...@hotmail.com =
wrote:</DIV></DIV>
<BLOCKQUOTE style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3Dgmail_quote>It has often occured to me that I =
have a function returning a std::unique_ptr. Naturally, I would expect this=
 to work:<CODE><BR></CODE>
<DIV style=3D"BORDER-BOTTOM: rgb(187,187,187) 1px solid; BORDER-LEFT: rgb(1=
87,187,187) 1px solid; BACKGROUND-COLOR: rgb(250,250,250); WORD-WRAP: break=
-word; BORDER-TOP: rgb(187,187,187) 1px solid; BORDER-RIGHT: rgb(187,187,18=
7) 1px solid"><CODE>
<DIV><CODE><SPAN style=3D"COLOR: #008">struct</SPAN><SPAN style=3D"COLOR: #=
000"> foo </SPAN><SPAN style=3D"COLOR: #660">{};</SPAN><SPAN style=3D"COLOR=
: #000"><BR><BR>std</SPAN><SPAN style=3D"COLOR: #660">::</SPAN><SPAN style=
=3D"COLOR: #000">unique_ptr</SPAN><SPAN style=3D"COLOR: #080">&lt;foo&gt;</=
SPAN><SPAN style=3D"COLOR: #000"> bar</SPAN><SPAN style=3D"COLOR: #660">(</=
SPAN><SPAN style=3D"COLOR: #008">bool</SPAN><SPAN style=3D"COLOR: #000"> ba=
z</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=
>&nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #008">if</SPAN><SPAN style=3D"C=
OLOR: #660">(</SPAN><SPAN style=3D"COLOR: #000">baz</SPAN><SPAN style=3D"CO=
LOR: #660">)</SPAN><SPAN style=3D"COLOR: #000"><BR>&nbsp; &nbsp; &nbsp; &nb=
sp; </SPAN><SPAN style=3D"COLOR: #008">return</SPAN><SPAN style=3D"COLOR: #=
000"> </SPAN><SPAN style=3D"COLOR: #660">{};</SPAN><SPAN style=3D"COLOR: #0=
00"><BR><BR>&nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #008">return</SPAN><=
SPAN style=3D"COLOR: #000"> </SPAN><SPAN style=3D"COLOR: #660">{</SPAN><SPA=
N style=3D"COLOR: #000"> </SPAN><SPAN style=3D"COLOR: #008">new</SPAN><SPAN=
 style=3D"COLOR: #000"> foo </SPAN><SPAN style=3D"COLOR: #660">};</SPAN><SP=
AN style=3D"COLOR: #000"><BR></SPAN><SPAN style=3D"COLOR: #660">}</SPAN></C=
ODE></DIV></CODE></DIV>The problem is the foo* constructor here, because it=
 is explicit (for very good reasons). What I have to write instead is the f=
ollowing:<BR>
<DIV style=3D"BORDER-BOTTOM: rgb(187,187,187) 1px solid; BORDER-LEFT: rgb(1=
87,187,187) 1px solid; BACKGROUND-COLOR: rgb(250,250,250); WORD-WRAP: break=
-word; BORDER-TOP: rgb(187,187,187) 1px solid; BORDER-RIGHT: rgb(187,187,18=
7) 1px solid"><CODE>
<DIV><CODE><CODE><SPAN style=3D"COLOR: #008">return</SPAN><SPAN style=3D"CO=
LOR: #000"> </SPAN><SPAN style=3D"COLOR: #660">std::unique_ptr&lt;foo&gt;{<=
/SPAN><SPAN style=3D"COLOR: #000"> </SPAN><SPAN style=3D"COLOR: #008">new</=
SPAN><SPAN style=3D"COLOR: #000"> foo </SPAN><SPAN style=3D"COLOR: #660">};=
</SPAN><SPAN style=3D"COLOR: #000"><BR></SPAN></CODE></CODE></DIV></CODE></=
DIV>It's not much better with a make_unique facility.<BR><BR>The same probl=
em applies to std::tuple too.<BR>
<DIV style=3D"BORDER-BOTTOM: rgb(187,187,187) 1px solid; BORDER-LEFT: rgb(1=
87,187,187) 1px solid; BACKGROUND-COLOR: rgb(250,250,250); WORD-WRAP: break=
-word; BORDER-TOP: rgb(187,187,187) 1px solid; BORDER-RIGHT: rgb(187,187,18=
7) 1px solid"><CODE>
<DIV><SPAN style=3D"COLOR: #606"></SPAN><SPAN style=3D"COLOR: #660">void fo=
o(std::tuple&lt;int, double, std::string&gt;);<BR><BR>foo({ 42, 3.14, "Hell=
o, World" }); // error<BR>foo(</SPAN><SPAN style=3D"COLOR: #660"><CODE><SPA=
N>std::tuple&lt;int, double, std::string&gt;</SPAN></CODE>{</SPAN><SPAN sty=
le=3D"COLOR: #660"><CODE><SPAN> 42, 3.14, "Hello, World" </SPAN></CODE>}); =
// works, but eww<BR>foo(make_tuple(</SPAN><SPAN style=3D"COLOR: #660"><COD=
E><SPAN>42, 3.14, "Hello, World"</SPAN></CODE>)); // works, but i didn't us=
e it for type deduction, which is against its intent<BR></SPAN></DIV></CODE=
></DIV>I think the {}-syntax is already explicit enough, therefore it shoul=
d allow calling explicit constructors without the type. Is there anything I=
 have missed?<BR></BLOCKQUOTE>

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_1382_10969448.1355850639932--

.