220 6990 <CAOfiQqn=iJMtL2w1PdjdSe971i2sXGeUf1=N6Msd3kbsJoWQrw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Richard Smith <richard@metafoo.co.uk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Unnamed LValues
Date: Fri, 4 Oct 2013 19:16:43 -0700
Lines: 117
Approved: news@gmane.org
Message-ID: <CAOfiQqn=iJMtL2w1PdjdSe971i2sXGeUf1=N6Msd3kbsJoWQrw@mail.gmail.com>
References: <CADbh+eSOH540anYnezFkm4_wK+MCtMh-01XNzAcMQMebdCPgRQ@mail.gmail.com>
	<CAOfiQqnr1C=78ARnZEvdNn=Pevz6nW1BhBz8tcFNcf9phJWEVg@mail.gmail.com>
	<CAGsORuAj=aPfp9CuaLXq_18XPsQ_cHwF3dYSyEtdhuopf8yNeA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7b677efa9d52de04e7f502a3
X-Trace: ger.gmane.org 1380939403 26450 80.91.229.3 (5 Oct 2013 02:16:43 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 5 Oct 2013 02:16:43 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDVNBJG4YAIBBC7NXWJAKGQEOTYXTGI@isocpp.org Sat Oct 05 04:16:48 2013
Return-path: <std-proposals+bncBDVNBJG4YAIBBC7NXWJAKGQEOTYXTGI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qa0-f69.google.com ([209.85.216.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDVNBJG4YAIBBC7NXWJAKGQEOTYXTGI@isocpp.org>)
	id 1VSHQD-0003CK-7b
	for gclcip-std-proposals@m.gmane.org; Sat, 05 Oct 2013 04:16:45 +0200
Original-Received: by mail-qa0-f69.google.com with SMTP id cm18sf4168527qab.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 04 Oct 2013 19:16:44 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=mime-version:sender:in-reply-to:references:date:message-id:subject
         :from:to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe:content-type;
        bh=+s18s8QhoFgXhXDMZf6BOWVfH4liaG0SzVuRXCHCB7I=;
        b=c1Sd3CX3rcPYz+5pTvJAeeZtY00h432FK4FKISpYCwOols0bVAH6h4vJmHxT3HHHnI
         kVB3jaO10F5ySxSQVantglhn39L/pdqOK43JfZ5z09ln48Cn5EFxNXc6MrEXKOBKhggr
         LFzWpPwckrQFJiHZgIi4fPKmlTc4NkC3Ja2SVf04ORdfn528wH4dko3Dj/5/BcM+gjci
         9dZPGqSPKRqyV5LwFuahr9FlWSXS7Xp48qM0Am0uGAZy/1+48/uyUmpjwW7Cp3DW8AFk
         1/2uLbVlt2tDbo2+fsQ067zsd/mSz3GEbqP+KddNZ67f4leqYf4SeGI2su3D++8O7AfF
         WBCA==
X-Received: by 10.236.32.74 with SMTP id n50mr16618538yha.13.1380939404324;
        Fri, 04 Oct 2013 19:16:44 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.134.74 with SMTP id pi10ls1549255qeb.35.gmail; Fri, 04 Oct
 2013 19:16:43 -0700 (PDT)
X-Received: by 10.58.74.38 with SMTP id q6mr15183586vev.9.1380939403788;
        Fri, 04 Oct 2013 19:16:43 -0700 (PDT)
Original-Received: from mail-vb0-x234.google.com (mail-vb0-x234.google.com [2607:f8b0:400c:c02::234])
        by mx.google.com with ESMTPS id g2si4245427vch.28.1969.12.31.16.00.00
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 04 Oct 2013 19:16:43 -0700 (PDT)
Received-SPF: pass (google.com: domain of metafoo@gmail.com designates 2607:f8b0:400c:c02::234 as permitted sender) client-ip=2607:f8b0:400c:c02::234;
Original-Received: by mail-vb0-f52.google.com with SMTP id f12so2698477vbg.11
        for <std-proposals@isocpp.org>; Fri, 04 Oct 2013 19:16:43 -0700 (PDT)
X-Received: by 10.58.137.167 with SMTP id qj7mr14775174veb.1.1380939403708;
 Fri, 04 Oct 2013 19:16:43 -0700 (PDT)
Original-Sender: metafoo@gmail.com
Original-Received: by 10.220.244.137 with HTTP; Fri, 4 Oct 2013 19:16:43 -0700 (PDT)
In-Reply-To: <CAGsORuAj=aPfp9CuaLXq_18XPsQ_cHwF3dYSyEtdhuopf8yNeA@mail.gmail.com>
X-Original-Sender: richard@metafoo.co.uk
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of metafoo@gmail.com designates 2607:f8b0:400c:c02::234 as permitted
 sender) smtp.mail=metafoo@gmail.com;       dkim=pass header.i=@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:6990
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/6990>

--047d7b677efa9d52de04e7f502a3
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Oct 4, 2013 at 7:06 PM, Zhihao Yuan <zy@miator.net> wrote:

> On Fri, Oct 4, 2013 at 9:33 PM, Richard Smith <richard@metafoo.co.uk>
> wrote:
> >   /*template<typename Mutex> std::lock_guard<Mutex> locked(Mutex &);*/
> >
> >   locked(my_mutex) {
> >   }
>
> This reminds me Python's with statement.  In C++, it may
> look like:
>
>   with (expr) {
>

The 'using' keyword would be unambiguous here.


>     // ...
>   }
>
>   If you need a name,
>
>   with (auto name = expr) {
>   }
>

Would this be exactly identical to

{
  auto name = expr;
  // ...
}

?


> And I can further imagine that this requires a
> _compound-statement_, so that we can have
>
>   struct A {
>     A() with (expr) {
>     }
>   };

-- 

--- 
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/.

--047d7b677efa9d52de04e7f502a3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Fri, Oct 4, 2013 at 7:06 PM, Zhihao Yuan <span dir=3D"l=
tr">&lt;<a href=3D"mailto:zy@miator.net" target=3D"_blank">zy@miator.net</a=
>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote=
"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:=
1px #ccc solid;padding-left:1ex">
<div class=3D"im">On Fri, Oct 4, 2013 at 9:33 PM, Richard Smith &lt;<a href=
=3D"mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>&gt; wrote:<br>
&gt; =A0 /*template&lt;typename Mutex&gt; std::lock_guard&lt;Mutex&gt; lock=
ed(Mutex &amp;);*/<br>
&gt;<br>
&gt; =A0 locked(my_mutex) {<br>
&gt; =A0 }<br>
<br>
</div>This reminds me Python&#39;s with statement. =A0In C++, it may<br>
look like:<br>
<br>
=A0 with (expr) {<br></blockquote><div><br></div><div>The &#39;using&#39; k=
eyword would be unambiguous here.</div><div>=A0</div><blockquote class=3D"g=
mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l=
eft:1ex">

=A0 =A0 // ...<br>
=A0 }<br>
<br>
=A0 If you need a name,<br>
<br>
=A0 with (auto name =3D expr) {<br>
=A0 }<br></blockquote><div><br></div><div>Would this be exactly identical t=
o</div><div><br></div><div>{</div><div>=A0 auto name =3D expr;</div><div>=
=A0 // ...</div><div>}</div><div><br></div><div>?</div><div>=A0</div><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex">

And I can further imagine that this requires a<br>
_compound-statement_, so that we can have<br>
<br>
=A0 struct A {<br>
=A0 =A0 A() with (expr) {<br>
=A0 =A0 }<br>
=A0 };</blockquote></div></div></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 />

--047d7b677efa9d52de04e7f502a3--

.
