220 31154 <3fcee1aa-2092-20c0-ee9c-7b81f1f81d0f@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Andrey Semashev <andrey.semashev@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Domains of specialized `vector` variance
Date: Sun, 26 Feb 2017 15:24:44 +0300
Lines: 47
Approved: news@gmane.org
Message-ID: <3fcee1aa-2092-20c0-ee9c-7b81f1f81d0f@gmail.com>
References: <38052307-8ef9-4d41-b902-826f56630c10@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Trace: blaine.gmane.org 1488111891 12234 195.159.176.226 (26 Feb 2017 12:24:51 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 26 Feb 2017 12:24:51 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.7.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCXY5TXHWYJRBD4SZPCQKGQE2KLQOAQ@isocpp.org Sun Feb 26 13:24:45 2017
Return-path: <std-proposals+bncBCXY5TXHWYJRBD4SZPCQKGQE2KLQOAQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f70.google.com ([209.85.215.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCXY5TXHWYJRBD4SZPCQKGQE2KLQOAQ@isocpp.org>)
	id 1chxsX-0002GL-V4
	for gclcip-std-proposals@m.gmane.org; Sun, 26 Feb 2017 13:24:41 +0100
Original-Received: by mail-lf0-f70.google.com with SMTP id g70sf4195974lfh.4
        for <gclcip-std-proposals@m.gmane.org>; Sun, 26 Feb 2017 04:24:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to: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=NjKFcNwwfkhkUC3YuwmbW0qrEUWezbIv3bxSIF9ihJk=;
        b=Sb+3LWY70auJqIYksW1tLQJNTJ2ae/gEvDpXK0Jpbm7o8+o0r4TTvgajJmWqkMHcay
         cNMim2VhhAukD93swzNXVb6QGFoPLDEsWqeEea4DiJ9pSW2o+fDd6XskkhbfTyGTruJ8
         LXlohDL1GWmGm6wk9HukNSI0G+NwJRY74vDIBpfcNQ8JVcLtwT34AoEkr5MKxLE7ASpS
         YWMrykTigxvPBf386v7ZXgyE9IOr8jWMW460DiAywkjjzgPjE6lPRZB7f2tmd42PW7Kv
         dww456mU+PlnlZxVsKwb1UEV5XZu0gubnH8oIEihU+/vLyOwa52YGry4fLkUYNZRYL2S
         mLtQ==
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:message-id:date
         :user-agent:mime-version:in-reply-to: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=NjKFcNwwfkhkUC3YuwmbW0qrEUWezbIv3bxSIF9ihJk=;
        b=ujNTvPopsAvJKzO7+4aZWJJiKVJMHYi3cF0q+yHAdE/dC4n9GiFFOzroT43iiimT8F
         oydEkUzb/9nAZUCuulRL1svodxPAcMha6N8efNtwbBppMrVH0yKaA719AMJhqmwl/vyr
         F41skW0YzWOJp3WouB20n6CPfJz2D148PVxOBiHcjEhhtuOey+COTK7sZv8D469SLbDp
         fngAbDNUmJIJoUdtnK9Ddnj3Dw18PBNMPgsf5NRvQtZOjxGdKESKpsCzppw9Q8dIAc42
         rSEtJTsR6cH6KOPntKs/vGIR9mHDBSsVYJixfLkoOSuyiH1CVb7xWRn5uJCK/fXbs6nu
         Cktw==
X-Gm-Message-State: AMke39kZlZJLiyXhydEWjn+wB3g1ETMwROD1IZZcx4oDAm6fgnrB2k2NKK2zIK2w30x9TA==
X-Received: by 10.25.205.129 with SMTP id d123mr1220568lfg.20.1488111888216;
        Sun, 26 Feb 2017 04:24:48 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.46.22.4 with SMTP id w4ls350559ljd.22.gmail; Sun, 26 Feb 2017
 04:24:47 -0800 (PST)
X-Received: by 10.46.32.194 with SMTP id g63mr2776000lji.47.1488111887219;
        Sun, 26 Feb 2017 04:24:47 -0800 (PST)
Original-Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com. [2a00:1450:4010:c07::22a])
        by mx.google.com with ESMTPS id 1si7330221ljo.65.2017.02.26.04.24.47
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 26 Feb 2017 04:24:47 -0800 (PST)
Received-SPF: pass (google.com: domain of andrey.semashev@gmail.com designates 2a00:1450:4010:c07::22a as permitted sender) client-ip=2a00:1450:4010:c07::22a;
Original-Received: by mail-lf0-x22a.google.com with SMTP id z127so23656126lfa.2
        for <std-proposals@isocpp.org>; Sun, 26 Feb 2017 04:24:47 -0800 (PST)
X-Received: by 10.46.80.71 with SMTP id v7mr3007449ljd.38.1488111886730;
        Sun, 26 Feb 2017 04:24:46 -0800 (PST)
Original-Received: from [192.168.1.2] (broadband-178-140-146-214.moscow.rt.ru. [178.140.146.214])
        by smtp.googlemail.com with ESMTPSA id u18sm9838040ljd.28.2017.02.26.04.24.45
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 26 Feb 2017 04:24:45 -0800 (PST)
In-Reply-To: <38052307-8ef9-4d41-b902-826f56630c10@isocpp.org>
X-Original-Sender: andrey.semashev@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 andrey.semashev@gmail.com designates 2a00:1450:4010:c07::22a as permitted
 sender) smtp.mailfrom=andrey.semashev@gmail.com;       dmarc=pass (p=NONE
 sp=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-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:31154
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31154>

On 02/25/17 20:41, Nicol Bolas wrote:
> There have been a lot of proposals and ideas thrown about for various
> `vector` classes that have identical interfaces but different behaviors.
> I'm wondering if it might not be better to have them all aggregated into
> some `omni_vector` type that uses a template parameter to pick which
> particular options you want.
>
> A necessary first step is to figure out what all of the options such an
> `omni_vector` might provide. Here are the ones I know about:
>
> * Small storage buffer (SSB) space: 0 to arbitrary number.
> * Maximum size: compile-time
> static/runtime-upon-construction/always-unbounded
>
> One of the advantages of having all of these variances in one type is to
> more easily require movement between them. So an `omni_vector` with
> SSB/16 and an `omni_vector` that has no SSB but has a fixed size can
> still be efficiently moved between so long as the allocators are the
> same (and if the SSB vector's current size is greater than its SSB size).
>
> Also, by putting them all in one type, you can create useful
> combinations. Like a vector that never allocates memory, because the SSB
> size is equal to the compile-time maximum size.
>
> Instantiating such a type might look like this: `omni_vector<Typename,
> ov_params<ov_ssb<32>, ov_max_static<32>>`. The order of such parameters
> would not be fixed; it would use template metaprogramming to pick the
> first parameter from the list for a particular option.
>
> What are the other variances that people want?

As a reference, see a few vector variants provided by Boost.Container:

http://www.boost.org/doc/libs/1_63_0/doc/html/container/non_standard_containers.html

Personally, I don't see the benefit of unification of various flavors of 
vector under the common name. Having specialized names, actually, makes 
more sense for code readability and searchability. I'm sure, it will 
also be better for compile times as there's no need for metaprogramming 
layer for sorting out policy template parameters.

-- 
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/3fcee1aa-2092-20c0-ee9c-7b81f1f81d0f%40gmail.com.

.
