220 22438 <CAGNvRgCgeNDgcJXUWQtqpR=eF=uVZpmHpDsZwm0QHXDd6jxdGw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: std::vector (and other containers) to have a
 perfect forwarding constructor
Date: Wed, 11 Nov 2015 10:33:47 +0100
Lines: 27
Approved: news@gmane.org
Message-ID: <CAGNvRgCgeNDgcJXUWQtqpR=eF=uVZpmHpDsZwm0QHXDd6jxdGw@mail.gmail.com>
References: <14fb89ea-443b-4696-93ec-29889f642bca@isocpp.org>
	<CAGNvRgBEn=wGT0Z3Wq+Pq4eKXinwEgsO66eQS6bw8WoCrgqC1A@mail.gmail.com>
	<cf9b040c-5008-4f40-bd53-0bf898f95ac2@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1447234469 26148 80.91.229.3 (11 Nov 2015 09:34:29 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 11 Nov 2015 09:34:29 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCT7RVFA4QORB64WRSZAKGQEAALIYZA@isocpp.org Wed Nov 11 10:34:28 2015
Return-path: <std-proposals+bncBCT7RVFA4QORB64WRSZAKGQEAALIYZA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f197.google.com ([209.85.217.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCT7RVFA4QORB64WRSZAKGQEAALIYZA@isocpp.org>)
	id 1ZwRmn-0008Cx-54
	for gclcip-std-proposals@m.gmane.org; Wed, 11 Nov 2015 10:33:49 +0100
Original-Received: by lbbko8 with SMTP id ko8sf7303605lbb.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 11 Nov 2015 01:33:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp_org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type: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=9MJg7GtjSOpw5PV7qslQ/m/CAW6gurLZzrLAFpYNqsA=;
        b=ntaeCkBWo9xA1vBbk+BoIUdxYi0PxMBGPsFVwp9y+wfbO2oS/yiCPNwVhpnvA0A8W1
         /OIQ6aG2Xz3bRzLtS84bXnkwV2us0zWNqpiMLHy6ojbtNzJpOl/nzHCkcus6ddmQTuJl
         /HtftrDs5AKlQRZ1xAQP560JdGSKl0IL3LVo360yRjzRXG30H4MW/BGWVz2gWiTkKkFm
         hdLYSqm1M4KzwiAcDLyvycpXvklp0WhgjJmi7qwDh0iss5XV2op6sdIxuP5yYAsEryI4
         Mb7sSgHuse94fGc3FY1dBe59LJKbBNMepNSNtS0tZyK0QOzBrj7DNDlzSqG54WoAFTC8
         T8Uw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type: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=9MJg7GtjSOpw5PV7qslQ/m/CAW6gurLZzrLAFpYNqsA=;
        b=MpKS/0fTAH4SjoY20UkQuwT3H+wSCk2BB7xryyrSRagI1oGDpoUF8PNrzNf6kcmrSf
         CEKq1gvNJ1Yi+eEeodnmKwjffGv3fCETiBcUDVfrja3usWlAPJ6obTvcAdzEL7HwHEen
         NbzipDAfDyxoPl5oAv5zypwN5qNl/3E7NbKYOZlmTVqHHklK4eJaCp1+2UCaOsawPo5v
         hxQrzllFdfjvVo9DmqaMXq0ramhfGiP654PI1zQIeiVHEA5G5P2p0hgxCmoI/T0qg29p
         zf4Imk+gsilQoDLyrvvzsy9RTNDexkKh06yJucpH47w31bMo79iym/WITilpJcdy8ZBO
         jaxw==
X-Gm-Message-State: ALoCoQn/mMJdNmUvGEci8inOBZwJ5jRMTLv7ANqh1eUftpKF3GwqROyTlvkE+Nwi4ZAgnUDrbqcL
X-Received: by 10.25.166.143 with SMTP id p137mr1189812lfe.0.1447234428591;
        Wed, 11 Nov 2015 01:33:48 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.139.143 with SMTP id n137ls1276772wmd.48.canary; Wed, 11
 Nov 2015 01:33:47 -0800 (PST)
X-Received: by 10.194.249.97 with SMTP id yt1mr7988433wjc.89.1447234427491;
        Wed, 11 Nov 2015 01:33:47 -0800 (PST)
Original-Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com. [2a00:1450:400c:c09::22b])
        by mx.google.com with ESMTPS id ao6si10572913wjc.158.2015.11.11.01.33.47
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 11 Nov 2015 01:33:47 -0800 (PST)
Received-SPF: pass (google.com: domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c09::22b as permitted sender) client-ip=2a00:1450:400c:c09::22b;
Original-Received: by wmec201 with SMTP id c201so172740659wme.0
        for <std-proposals@isocpp.org>; Wed, 11 Nov 2015 01:33:47 -0800 (PST)
X-Received: by 10.28.21.9 with SMTP id 9mr10439499wmv.22.1447234427171; Wed,
 11 Nov 2015 01:33:47 -0800 (PST)
Original-Received: by 10.28.18.129 with HTTP; Wed, 11 Nov 2015 01:33:47 -0800 (PST)
In-Reply-To: <cf9b040c-5008-4f40-bd53-0bf898f95ac2@isocpp.org>
X-Original-Sender: daniel.kruegler@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c09::22b as
 permitted sender) smtp.mailfrom=daniel.kruegler@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE 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-Spam-Checked-In-Group: 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:22438
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/22438>

2015-11-11 10:20 GMT+01:00  <leni536@gmail.com>:
> Yeah, that was truly a mistake by me, perfect forwarding really doesn't make
> sense in this context. Shouldn't this work though?
>
> vector(size_type n,vector::forward_args_type,Args&... args);
>
> This way even if something in args is an rvalue reference its type would be
> deduced to be an lvalue reference.

I would say the arguments should also be declared as references to
const, because you can also have the same effect for mutable lvalues.
And surely you would like to construct from a pack from literals
(which are rvalues in basically all cases), which would not be
possible with your revised form:

std::vector<Foo> v(100, 12.123); // Wouldn't work

- Daniel

-- 

--- 
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/.

.
