220 12595 <038222e0-66c3-4837-b158-e911dffb3c55@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Adi Shavit <adishavit@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Questions about N3949 - Scoped Resource - Generic
 RAII Wrapper for the Standard Library
Date: Sun, 31 Aug 2014 07:03:18 -0700 (PDT)
Lines: 69
Approved: news@gmane.org
Message-ID: <038222e0-66c3-4837-b158-e911dffb3c55@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_146_320931048.1409493798857"
X-Trace: ger.gmane.org 1409493807 11096 80.91.229.3 (31 Aug 2014 14:03:27 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 31 Aug 2014 14:03:27 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDMLX45JSIJBBJ6WRSQAKGQEIZCCS6A@isocpp.org Sun Aug 31 16:03:21 2014
Return-path: <std-proposals+bncBDMLX45JSIJBBJ6WRSQAKGQEIZCCS6A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f200.google.com ([209.85.213.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDMLX45JSIJBBJ6WRSQAKGQEIZCCS6A@isocpp.org>)
	id 1XO5iy-0002kC-St
	for gclcip-std-proposals@m.gmane.org; Sun, 31 Aug 2014 16:03:21 +0200
Original-Received: by mail-ig0-f200.google.com with SMTP id uq10sf25174886igb.3
        for <gclcip-std-proposals@m.gmane.org>; Sun, 31 Aug 2014 07:03:19 -0700 (PDT)
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=RHEEyNzn8WwmsDIl+nlegJyyfm6fICLL1HtWGHnm8ro=;
        b=MTSnQqOKPek/vwW6ypY6e8HPRXVT4nCuw37r+uGGK+gReuywL4FLmu5FTeObWJcqje
         2CuWbZsi12XoFyxcvK5eHuW3lhY7Z5TYVSULLz64twY2IAcWsPar70o8Kv+awZGKMWZw
         Gm5mUfZHJVlP5StvbKqexNiuNL8WZ6srrGniTU2RJC3sJI4XgrPhEPjmjKYZqs3tv/iu
         Df48d5U7mPPIV4tQLZotq0QTtzDNuiejX+h+r+lMrqplkdim13o9YppUFfDt5cYhSu6j
         kTYyW04dslSfRGu+uIITsMJw4miHX6vNeh2m1gS1wU7kzHmBOx4TfncQaYg2j94dASjh
         reUg==
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=RHEEyNzn8WwmsDIl+nlegJyyfm6fICLL1HtWGHnm8ro=;
        b=Dw20FCwp7vOO6TTbBQYvcc8GRqDm76F7mnE/LeNrwz2azwbaNaEUpdMJi1rMdl8eci
         XkegvYqow0guyImacNBCtRn6507JupWJnca61a54CKqPSHtkvMTCxug/phuSfLWze9Fj
         uNdoV+HcqT+vmgH8yGW0WLjfpHLZEU6NxZ8GawTVl35DLYPOcZOv02WdKHOXl9F9D3aK
         GRchu4C1FG2VL5dZejj4Ihxo0w+HDiVsba7pTzDwX6fRagCEc0pjLf6o/fnJ/vatHNDz
         z5cgdWw/pZam18TWK86Dfba6eknKT5yA0AeKhV/Ouj4ddug/MWGI+RX94qAMJVlX/f8B
         EKGw==
X-Gm-Message-State: ALoCoQkgExy6DfGiYfpZV8y4+F0nSB3bmx5tlu61Oas6bLuNGLe+KKBslk6pOXhhZcRPQyW91VEc
X-Received: by 10.182.186.4 with SMTP id fg4mr13146373obc.9.1409493799789;
        Sun, 31 Aug 2014 07:03:19 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.84.176 with SMTP id l45ls1678878qgd.81.gmail; Sun, 31 Aug
 2014 07:03:19 -0700 (PDT)
X-Received: by 10.140.105.52 with SMTP id b49mr455319qgf.3.1409493799062;
        Sun, 31 Aug 2014 07:03:19 -0700 (PDT)
X-Original-Sender: adishavit@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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:12595
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/12595>

------=_Part_146_320931048.1409493798857
Content-Type: text/plain; charset=UTF-8

Hi,

  It is often useful to have resources as members of a class to be cleaned 
upon destruction (this is what RAII is all about!).
However, to declare a member of scoped_resource in the class header, I 
would need to know the type of the deleter (as opposed to, e.g. shared_ptr 
which does not require this).
I guess I could use decltype in the member type definition, but that would 
require stating the actual deleter at 2 different places: header + the 
initialization.

All the examples I saw use 'auto' for local scope, but AFAIK, you cannot 
use auto in the class declaration since the size needs to be known at 
compile time.
Am I missing something here or is this by design?
What is the rational for this and how would one a succinct scoped_resource 
declaration?

Warm regards,
Adi
 

-- 

--- 
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_146_320931048.1409493798857
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>&nbsp; It is often useful to have r=
esources as members of a class to be cleaned upon destruction (this is what=
 RAII is all about!).</div><div>However, to declare a member of scoped_reso=
urce in the class header, I would need to know the type of the deleter (as =
opposed to, e.g. shared_ptr which does not require this).</div><div>I guess=
 I could use decltype in the member type definition, but that would require=
 stating the actual deleter at 2 different places: header + the initializat=
ion.</div><div><br></div><div>All the examples I saw use 'auto' for local s=
cope, but AFAIK, you cannot use auto in the class declaration since the siz=
e needs to be known at compile time.</div><div>Am I missing something here =
or is this by design?</div><div>What is the rational for this and how would=
 one a succinct scoped_resource declaration?</div><div><br></div><div>Warm =
regards,</div><div>Adi</div><div>&nbsp;</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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<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_146_320931048.1409493798857--

.
