220 18787 <CAFk2RUajW02oZJKC1nePfEUg1B+Z4aoe3A3e-+u0UpzqA6qnjA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: std::vector - adding support for non-moveable,
 non-default constructible types with lambdas
Date: Thu, 25 Jun 2015 22:07:49 +0300
Lines: 44
Approved: news@gmane.org
Message-ID: <CAFk2RUajW02oZJKC1nePfEUg1B+Z4aoe3A3e-+u0UpzqA6qnjA@mail.gmail.com>
References: <06317928-6af2-4133-a38e-8d6c829f311b@isocpp.org>
	<CAFk2RUZYc+Cxm8qDrhSd7Pg2fkEeOtStM=pytuM3wgJs8w6NiA@mail.gmail.com>
	<CAFk2RUZO0e-P5q0SKr_ABRH=nqsRQYM8jCt4LgU-na=GHk2PYw@mail.gmail.com>
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 1435259293 4994 80.91.229.3 (25 Jun 2015 19:08:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 25 Jun 2015 19:08:13 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBBNDWGWAKGQE5GFX26Q@isocpp.org Thu Jun 25 21:07:59 2015
Return-path: <std-proposals+bncBC5JHI7A7ALRBBNDWGWAKGQE5GFX26Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f199.google.com ([209.85.213.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBBNDWGWAKGQE5GFX26Q@isocpp.org>)
	id 1Z8CV9-0005jz-TJ
	for gclcip-std-proposals@m.gmane.org; Thu, 25 Jun 2015 21:07:56 +0200
Original-Received: by igbqq3 with SMTP id qq3sf142197036igb.2
        for <gclcip-std-proposals@m.gmane.org>; Thu, 25 Jun 2015 12:07:50 -0700 (PDT)
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=zt8Ob3yFWyy4IfiFJf52y3aIp5pUwntKf9x+NxoiFlM=;
        b=Yn+f50EDiMOzdu1+Vz/tgqevYTIvyYrjyz/7qUxnD82/nMLevZlzNRRwo5TAuz6s0G
         65i9mdQxBaExP6hPwjaUO53NhX+7T+Rdg4zqwEvrwQ1mEsBSoMbFM5TSMpPqgEtCleFF
         t9MzLaZlas7QL1R6tKT5j42W5aHanhq6Twk+E4PKDzy9hcW5rE5ElsO8pXUXb2HtSovL
         cksgm/zVWmCF/l8V4KNfwGgbTkulhDDXBgbV9cxEbTMpYGzXRAQrHQuvosf3SXAl1PmC
         AfcDxS+vXY0FrdI9GCOBiUTVM8FsMDwaX2gZDqdiyzPwX89ouYXaWrItpLI5kAr05G6G
         INPQ==
X-Gm-Message-State: ALoCoQmzW9ZnTjce1f/Gvb/C1cwrvtcWyrkViTPPabsI+Myn2EoldRS6QJO+nhhyFxuRRL2fvQQ+
X-Received: by 10.182.200.197 with SMTP id ju5mr61946897obc.28.1435259269956;
        Thu, 25 Jun 2015 12:07:49 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.66.147 with SMTP id f19ls2109916igt.43.canary; Thu, 25 Jun
 2015 12:07:49 -0700 (PDT)
X-Received: by 10.107.8.210 with SMTP id h79mr40104758ioi.27.1435259269330;
        Thu, 25 Jun 2015 12:07:49 -0700 (PDT)
Original-Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com. [2607:f8b0:4001:c05::230])
        by mx.google.com with ESMTPS id pf6si25981698icb.107.2015.06.25.12.07.49
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 25 Jun 2015 12:07:49 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:4001:c05::230 as permitted sender) client-ip=2607:f8b0:4001:c05::230;
Original-Received: by igin14 with SMTP id n14so62229358igi.1
        for <std-proposals@isocpp.org>; Thu, 25 Jun 2015 12:07:49 -0700 (PDT)
X-Received: by 10.50.30.105 with SMTP id r9mr6215877igh.11.1435259269209; Thu,
 25 Jun 2015 12:07:49 -0700 (PDT)
Original-Received: by 10.36.152.7 with HTTP; Thu, 25 Jun 2015 12:07:49 -0700 (PDT)
In-Reply-To: <CAFk2RUZO0e-P5q0SKr_ABRH=nqsRQYM8jCt4LgU-na=GHk2PYw@mail.gmail.com>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:4001:c05::230 as
 permitted sender) smtp.mail=ville.voutilainen@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:18787
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18787>

On 25 June 2015 at 22:05, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
> On 25 June 2015 at 19:12, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
>> On 25 June 2015 at 19:06, Matthew Fioravante <fmatthew5876@gmail.com> wrote:
>>> If you have a type T that has deleted move/copy operations and you want to
>>> store objects of this type in a vector you are forced to default construct
>>> the elements use the vector<T>::vector(size_t) constructor. After this you
>>> can naturally not push_back(), insert(), reserve(), etc.. as all of those
>>> operations may require moves.
>>>
>>> If we want to call a different constructor, or we don't have a default
>>> constructor for T we are out of luck and cannot use vector.
>>>
>>> We need to modify the behavior inside of vector's constructor to customize
>>> which constructor for T is actually called. The way to do this is with
>>> functional programming, that is we pass in a lambda to the vector
>>> constructor telling it how to construct each element.
>>>
>>> I presented an idea similar to this in a different thread for another array
>>> type, but I think this idea could be applied to vector.
>>
>> This might be useful background:
>> http://cplusplus.github.io/LWG/lwg-defects.html#704
>>
>> At one time, Gabriel Dos Reis discussed relaxing some of the type requirements
>> for vector, but I don't think either of us were able to materialize
>> that discussion into
>> a proposal. Both of us are fairly busy, so I cannot promise that
>> either will be able
>> to provide much assistance. Gabriel might have good suggestions. Maybe.
>
> Ah. Also see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4416.pdf.
> That
> proposal was rejected by LEWG, though.

The discussion summary is at https://issues.isocpp.org/show_bug.cgi?id=87

-- 

--- 
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/.

.
