220 41413 <de706d53-f3c1-1810-ff61-cc6cc4f40270@gmail.com> article
Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Overloading `using` for temporary scopes
Date: Tue, 29 Jan 2019 11:42:15 -0500
Approved: news@gmane.org
Message-ID: <de706d53-f3c1-1810-ff61-cc6cc4f40270@gmail.com>
References: <41a2bed6-6738-cd11-0037-9a471f8a75d5@gmail.com>
 <q2pnql$1mvo$1@blaine.gmane.org>
Reply-To: std-proposals@isocpp.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226";
	logging-data="175492"; mail-complaints-to="usenet@blaine.gmane.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.4.0
To: std-proposals@isocpp.org, David Brown <david@westcontrol.com>
Original-X-From: std-proposals+bncBC37LBFWUIFBB2UEYLRAKGQE7GXI36Q@isocpp.org Tue Jan 29 17:42:22 2019
Return-path: <std-proposals+bncBC37LBFWUIFBB2UEYLRAKGQE7GXI36Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt1-f200.google.com ([209.85.160.200])
	by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.89)
	(envelope-from <std-proposals+bncBC37LBFWUIFBB2UEYLRAKGQE7GXI36Q@isocpp.org>)
	id 1goWSq-000jUj-AA
	for gclcip-std-proposals@m.gmane.org; Tue, 29 Jan 2019 17:42:20 +0100
Original-Received: by mail-qt1-f200.google.com with SMTP id d35sf25393487qtd.20
        for <gclcip-std-proposals@m.gmane.org>; Tue, 29 Jan 2019 08:42:20 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1548780139; cv=pass;
        d=google.com; s=arc-20160816;
        b=qDhaA4OTLo7ASWVdX0NMN8IhvaitKu5pnpBonMWF4dAWcSiH2UkSbqBfA5YHvoOGZn
         sb9EDxFi7JOpbSM7FgCLkHs+h9FgEcafmGHO3dyBqLDnCud5KkOvkR1mR1n86yE6N4Q9
         i8zT9E/rBgDm8tWdqaEVbIT5PRINOEhe9g+YNw6z452WGaYlGnZUP+0ijQ7Ze14qYPEZ
         lJ+6yLyIp+Hc1t/WKrkQLP7YCgi54V3oJGLwGAt65ka8KqU0FKakUqT275Ywuf/wotjf
         lMOPdwThAWjkoUarx5W5VmN0E82BxyQ0zD4mCnOh0IYJyTq01utZR30BlIG/XaU32bQn
         lVDQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-language
         :in-reply-to:mime-version:user-agent:date:message-id:openpgp:from
         :references:to:subject:dkim-signature;
        bh=f+PzANwhtLpEUmC2GqplSjgcViVwSbkTmWn0koguekE=;
        b=syEPb4pGa42UpBsetjqxOXYOTtfyB/6jQmxnvwNl19yEka1OVoGxAZZyv0dzUWU/M4
         kcWqgubhD1lBUkCEiquga9w7MEd4NK+GKiVWwFE1tb+qi2HTY1DcsLGbUOI8FJF6Yfwt
         P7gZ2w6tQagO2WXkYeW8NZdW9vcVb1qQv0NQVcHSZgVIrPuUgvJkAuPfXhscZJI+myUp
         CyeGRncAuHRSpJDc1YC2KmXdT59PYQNDpDFAdauBtMMaYlQ0VTf3w9z+gURfg1zwY3eB
         o6IXydFjZ50CVYO4mlOTdv1H30ooypbm8mBaIdPKMXpOwrUVCmUwO/Cr3PR5IQDSCH/0
         IZfw==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=LG5HmA+O;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:openpgp:message-id:date:user-agent
         :mime-version:in-reply-to:content-language:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=f+PzANwhtLpEUmC2GqplSjgcViVwSbkTmWn0koguekE=;
        b=0EeIFheVUvQFDG4UlgH1md/6eQtrWXAiaG0ra3aZEq9UZJ6opAnYEZCdPrNRRL6eTc
         HB74HHqbzTfExnJZ3DNG5R4HgMoUYdwsqZop7mhiD0LHysU3bdFQAWqiag7pCAMcuWye
         uccu3jEs1B1AumS1BFE8vWIcW0bUoQkGazc4AG+xUGrkFZtQ91EEtEyYWfvT3INDWffI
         j1rah2HgBdlC1keV3wiIU9i5LipMjexvEydRTi22n2Kp/sJnN6lbs2U/0rwhBtlCMm4Q
         yR6f1KrBTaJCtSHwW43aNi+CvwS9cvNQArk+c9dhJ9wnQOG1HXhrhriEbrePAL1pUtFB
         tgUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:references:from:openpgp:message-id
         :date:user-agent:mime-version:in-reply-to:content-language
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=f+PzANwhtLpEUmC2GqplSjgcViVwSbkTmWn0koguekE=;
        b=fFI4sW7BsGVv46DVjDSRwVe/MVacPWrH+sK6qwucmm8za7kBIQ/v5VT5CTb/kgq4uj
         xWBZ5zTkKgLqW9+0rcIwn6cXnlosZt+ev5t7gWwVV1yg9XSRq8R5m2/bsFmlY+wLdqBn
         8Y/+bHNu31gRUWKkqXVAThY4RmtG/3SDEKYnz9IjK2fZlbSGYm/egWO3FDBiwgdJus8O
         RRAumzuXkl/ztHMIeQ6yDMgIrFAyZiykPE5PVMhRw2QyqR23ZElA2OBY0PmbjRIgJMgN
         uHbXZLuOCVFtO8jC6Ao2tLp1fSgSR2Wg5ZWazilR+UNStXqj4Ng802PMmo84hGFSU2WG
X-Gm-Message-State: AJcUukertx6u2tDzTYZ2/8Hb9jJ6a5McGlZi5ytInZer7TYDQH4PKaZX
	773T1exySG1jiDbn9AQra4dwKw==
X-Google-Smtp-Source: AHgI3IaSS8R2KwnPSC5ESXhf8ju4DPW3cuaenRUqyk3RK14FODawK4SYRRyoz12nFrwdSJf1hr2AoA==
X-Received: by 2002:aed:36ea:: with SMTP id f97mr3492212qtb.60.1548780138938;
        Tue, 29 Jan 2019 08:42:18 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:ac8:321a:: with SMTP id x26ls9661521qta.4.gmail; Tue, 29 Jan
 2019 08:42:18 -0800 (PST)
X-Received: by 2002:ac8:73c4:: with SMTP id v4mr25820513qtp.157.1548780137917;
        Tue, 29 Jan 2019 08:42:17 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1548780137; cv=none;
        d=google.com; s=arc-20160816;
        b=Sej84sIHN9FFESO7Juid+TnYTJGBj12nIfVyns9L0iNxCL91KQpzA2Wv2wmJFLr16F
         pyp1Fxo1Y9gFE55nukzlhhEFBoCPTg/bknqFwdyc/nH4/XrEfR+YQrZAF+Ui+Cfgmu7l
         Eln4tqy0I3ckw/5Ybhe3aOr6IFditvK5YKumfp2+jOzw/R9MKnpovXo5DVpNTQeEgN1N
         WYzv2ijs0xB+/cXjNfcujD6li/1TubK7JWCWWbUnC3/3fQRjX+V9ya8f166zi8VnXJly
         O944+IcnoGojo/13YFcaqdi0bApbOh5v/m+GqASIGHe7mrFPdLLBzJlBmvkdRVvLKi1Q
         APAA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:openpgp:from:references:to:subject
         :dkim-signature;
        bh=q/+jQGLERBDOjCrBWH0mFDlG/XQpVipFGL1mAlLHOOA=;
        b=YvKGYOYjpJmWSQIA9s/jtRyXj98C7IeISNUms6lYcZ5Qhk/V9I9qFYQ7B2GgRcUV+G
         /O5FN9eNBJpyN0Uc8SELRWTdLwFA0/y5XLtGTnEjPAJd9vd0cdRBi6U3MjMpkMNriekK
         Iu6YO9JP8y1eYJMfrOv2PJ0Ct45wxqIGkNv8gT4KPOzlWVsbsyPeBo+d27e4sl0p+9KP
         OKCnS6CYC4uu4IeIxWA0bTmEVzHHw+/Jzih80Z2aOSyIMf3PMDaORtGbxMuR4o/37VWB
         g5Y7XQgOnnWwDiOqC9ZSJIHe1AOU0rkJZMw4XbV2qHk2fSLyvm8AK4zhy2Zp9V3EY1Zq
         opAg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=LG5HmA+O;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id r70sor62203485qkl.130.2019.01.29.08.42.17
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Tue, 29 Jan 2019 08:42:17 -0800 (PST)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a37:81c4:: with SMTP id c187mr24155482qkd.114.1548780137777;
        Tue, 29 Jan 2019 08:42:17 -0800 (PST)
Original-Received: from gryphon.kitware.com (tripoint.kitware.com. [66.194.253.20])
        by smtp.googlemail.com with ESMTPSA id j138sm54178071qke.65.2019.01.29.08.42.16
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 29 Jan 2019 08:42:16 -0800 (PST)
Openpgp: preference=signencrypt
In-Reply-To: <q2pnql$1mvo$1@blaine.gmane.org>
Content-Language: en-US
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=LG5HmA+O;       spf=pass
 (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE dis=NONE) header.from=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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:41413
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/41413>

On 29/01/2019 09.26, David Brown wrote:
> On 28/01/2019 17:20, Matthew Woehlke wrote:
>> I often wish C++ had the equivalent of Python's `with` [...] I 
>> wonder if there would be any perceived value in having a dedicated
>> syntax for this? I'm thinking [e.g.]:
>> 
>>   with (auto x = expr())
>>   with (expr())
> 
> Basically, what you want is to be able to give "expr()" a name so that
> it stays in scope, but you don't want to give it a name because it isn't
> something you are going to use.

Yes. But *sometimes*. Eventually I think we will get a way to declare an
anonymous variable; too many people have wanted it for too long. The
reason my proposal might be interesting is because it is one syntax that
allows *either* naming the temporary or not naming it.

-- 
Matthew

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/de706d53-f3c1-1810-ff61-cc6cc4f40270%40gmail.com.

.
