220 8996 <df286e83-063b-4e82-9843-6a70a15a5fd3@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: otakuto otakuto <otakuto5648@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Auto constructor to variable that has been declared type.
Date: Sun, 2 Feb 2014 07:16:44 -0800 (PST)
Lines: 75
Approved: news@gmane.org
Message-ID: <df286e83-063b-4e82-9843-6a70a15a5fd3@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_530_127588.1391354204299"
X-Trace: ger.gmane.org 1391354200 24031 80.91.229.3 (2 Feb 2014 15:16:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 2 Feb 2014 15:16:40 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDTMFIUB4IKRBXOCXGLQKGQEDFNRGPQ@isocpp.org Sun Feb 02 16:16:48 2014
Return-path: <std-proposals+bncBDTMFIUB4IKRBXOCXGLQKGQEDFNRGPQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yk0-f197.google.com ([209.85.160.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDTMFIUB4IKRBXOCXGLQKGQEDFNRGPQ@isocpp.org>)
	id 1W9ymt-00022Y-Pu
	for gclcip-std-proposals@m.gmane.org; Sun, 02 Feb 2014 16:16:48 +0100
Original-Received: by mail-yk0-f197.google.com with SMTP id 20sf37530974yks.0
        for <gclcip-std-proposals@m.gmane.org>; Sun, 02 Feb 2014 07:16:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe:content-type;
        bh=jTw3uw9LrY1yLqNPKqK0dy+psMoiuUc6U/UkCiiNyFc=;
        b=OnWIvo2SVu3XMWYnvtM9KOd1m57M1V1a7rx/jQg/SFNquJgCkSCIgyJglqVy2JjXDj
         YMsanGcpvUGqSk+/vxj4HXl5hVK9QQFXiS0EJ3MKcgg5CyjlZxQKZz1F9sC5Qav/WoRj
         jxAaqs28RMrfpZ8CWFUP1SST5xkKeiBgGs98mvrWsNSYSO5QMqAGRYesOmoqg9a+MWXm
         H06hxXvw3zCCx+YaZsva6pooaTNsKHHi70PspPUhnwz+GW8z3KuoeE6A7RuotSTGKFvo
         Y7OPTxT0h5TV/W36L/ay5dApJLEMGmFwHiaKz6PRnOFw4k2JYoahJykzR9Q0gY/NI1En
         /BfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=jTw3uw9LrY1yLqNPKqK0dy+psMoiuUc6U/UkCiiNyFc=;
        b=HLxPPCfMDbCnz2Kemasx3i6jgfiND+ZOO3eMbB5t9RQo25Y4VmT1BdedojkUIcZBHf
         M8OoEne5STncYtYz+E5OiJWNG+8LQTw5+pLm5oL/bm8tTNM1765s5TskP1rWroA4CV2+
         zPmKaRZIBT7Z99OGfw7ByKmOHGkJ+LMeHK/oFOc7AqkW+5Oc4avlIaJV15U6E/LGocMA
         i/S7HFcCMSi3MN51sPO7pf5FaX9WqbANzxWyBxiZDRA73OQRaM5rsgn1ZulvtA074vdk
         nSGvCpghQcm9J+a/SUkEU16Tugi0zI5tRVb4ay1LoFOmF8I6sBK+ChsV4P9WHYb+tZCm
         7kdw==
X-Gm-Message-State: ALoCoQm/sDJMwOBskWkvdEL2XOSdcRJ0P1HhlWW7YuGy0LmHrqZWTfwdhoo/PPqGdhRIgwecSHHb
X-Received: by 10.236.145.34 with SMTP id o22mr10845456yhj.22.1391354206745;
        Sun, 02 Feb 2014 07:16:46 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.43.230 with SMTP id z6ls1458079igl.25.canary; Sun, 02 Feb
 2014 07:16:45 -0800 (PST)
X-Received: by 10.50.85.81 with SMTP id f17mr32947igz.12.1391354205644;
        Sun, 02 Feb 2014 07:16:45 -0800 (PST)
X-Original-Sender: otakuto5648@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:8996
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8996>

------=_Part_530_127588.1391354204299
Content-Type: text/plain; charset=UTF-8

Now that in C++, auto constructor is calling constructors by type deduction 
of constructor arguments.
But I want to call constructors by type deduction of variable when auto 
constructor to variable that has been declared type.
Where you can not use auto variable, for example the type of the 
initialization of the member variable will be able to be abbreviated.

#include <vector>
#include <type_traits>

struct foo
{
    std::vector<int> a;
    std::vector<int> *b;
    foo()
    {
        //This is the same as "a = 
std::remove_pointer<decltype(a)>::type();" or "a = decltype(a)();"
        a = auto();

        //This is the same as "b = new 
std::remove_pointer<decltype(b)>::type();"
        b = new auto();
    }
};

Thank you

-- 

--- 
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_530_127588.1391354204299
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Now that in C++, auto constructor is calling constructors =
by type deduction of constructor arguments.<br>But I want to call construct=
ors by type deduction of variable when auto constructor to variable that ha=
s been declared type.<br>Where you can not use auto variable, for example t=
he type of the initialization of the member variable will be able to be abb=
reviated.<br><br>#include &lt;vector&gt;<br>#include &lt;type_traits&gt;<br=
><br>struct foo<br>{<br>&nbsp;&nbsp;&nbsp; std::vector&lt;int&gt; a;<br>&nb=
sp;&nbsp;&nbsp; std::vector&lt;int&gt; *b;<br>&nbsp;&nbsp;&nbsp; foo()<br>&=
nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //This is=
 the same as "a =3D std::remove_pointer&lt;decltype(a)&gt;::type();" or "a =
=3D decltype(a)();"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a =3D aut=
o();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //This is the same a=
s "b =3D new std::remove_pointer&lt;decltype(b)&gt;::type();"<br>&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b =3D new auto();<br>&nbsp;&nbsp;&nbsp; }<=
br>};<br><br>Thank you<br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to 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_530_127588.1391354204299--

.
