220 33164 <CAGNvRgBnrZXiiQQy_8eVukE-F365uuXgwFMffvdNbyJ+_S=O2g@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Add a few missing things from the iterator library
Date: Mon, 10 Jul 2017 20:21:23 +0200
Lines: 32
Approved: news@gmane.org
Message-ID: <CAGNvRgBnrZXiiQQy_8eVukE-F365uuXgwFMffvdNbyJ+_S=O2g@mail.gmail.com>
References: <e45d0f40-ac12-4df3-9532-8c9481e7791a@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"
X-Trace: blaine.gmane.org 1499710887 1932 195.159.176.226 (10 Jul 2017 18:21:27 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 10 Jul 2017 18:21:27 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCT7RVFA4QORBJELR7FQKGQEQIXJNYQ@isocpp.org Mon Jul 10 20:21:21 2017
Return-path: <std-proposals+bncBCT7RVFA4QORBJELR7FQKGQEQIXJNYQ@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+bncBCT7RVFA4QORBJELR7FQKGQEQIXJNYQ@isocpp.org>)
	id 1dUdJA-0000C7-Sm
	for gclcip-std-proposals@m.gmane.org; Mon, 10 Jul 2017 20:21:20 +0200
Original-Received: by mail-lf0-f70.google.com with SMTP id w198sf24732796lff.14
        for <gclcip-std-proposals@m.gmane.org>; Mon, 10 Jul 2017 11:21:26 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1499710886; cv=pass;
        d=google.com; s=arc-20160816;
        b=lFeGhhlt92FP1BeVFpScif3I6RZgyp1OLiFwe9xz0ackDHkQn8rCFjU+KEAf85X+/+
         QQaVuARQSGlT+4uBEyTR5zuiac4p0twmrCy8Qdfdp3y5OpPp+Hk51ilJkx3qXnEooCsm
         40PNwchzIIITODfonPwph/5xZcFj5yak8p85BQfRCbVIMSXLmQ8QNrcDbxGeJF6n37ih
         fva+EYs/qHIrwrEIAIC88YqiesrdKim4HJEkgAeymIReV5ch8CegEV1GTiLJbW4uqasb
         tI/VOEc/wtj6rZlPu9bEpRyUhY/QI4GBTZ1A3nZjCCPlqe+T4c9uL3JU8pouUf8w9JPI
         41YA==
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:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=M7ilSV4YOznsxJAsP8UTYRrHJjPVGYGzJebwS9JJduQ=;
        b=uRtZxB3PfakBHbiX9RX1WAz/r0GmYurHQhXYIMmnMM3x6u0yrh+dhHIZJiWEy1d2Dz
         0Wz+Mn7yavFLJLUzZxJ0o6K78NDN4yavk/p7OVpXy5/cJiEjVzz4WHlrt6zgPNe+RkGc
         Aa55UDeWF1ibCYjAsNP1u3HlDDOfp00v31FTxlrGlxI6gm22YnTd/M5JfrSW6kRK+wy3
         IjcmSlLksffP0aDwtIZADQlWBL88+qPxFFsqJPD3OALQh1aAxEP93/9Q0NGMjrD3DmUZ
         KjksXgyD3kt5A0gOB3X3k9XEe6biXzVAB2Uhtc0Mqu65reRsw0MGksG7s4/0Iv6M8naw
         Lnuw==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=B+xfaFab;
       spf=pass (google.com: domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c0c::22a as permitted sender) smtp.mailfrom=daniel.kruegler@gmail.com;
       dmarc=pass (p=NONE sp=NONE 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=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :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=M7ilSV4YOznsxJAsP8UTYRrHJjPVGYGzJebwS9JJduQ=;
        b=yAkQvEXQqWV4al6FlPk8amGVmJPJxvRGyMtBGjjEKwJZPNvGYkPtQZo1M9LTqj8AsO
         YPieENTOmSvLdUZyD0dN3fUak+qMPuMmpZZDnRjJGLKJicqZXpzKlMdJrYhhNHMdiR8i
         k3WbgGTxKFAl7i9a6j0Xd7+AyxNm06/thmiD5xgt9IGMQTNz2JUCgf5X6Ua080L8WcAA
         4Db0H0KNwBbfYCkp2p5rPsYwfgxWzMa0Y+gvgnu5p3T3Rj4U/v23GCOyUIM1Xf+FXjHM
         kqrLLrNWHYFKUcJ28RfP5MfZUehK6dhv+RTcL8rDH+7mmZoEHbamkn1Bmq03Vr1cSpB/
         oAcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject: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=M7ilSV4YOznsxJAsP8UTYRrHJjPVGYGzJebwS9JJduQ=;
        b=KF19ObJ4MFsSgCO+toRQz1nBg2l+tC2/XawJocPmLSjeVRiSlR3F5FZNU+hFOlEZ0j
         225YAIA5gbIVff80cctf2PWzk3m8BqHbIyenIoVBLgPsJqPUxPkvgTyr1ZscsB3n9Hy5
         YTNNOsOjuDv1CuPGcd7QNsS4AQ67UsLgmqKzZF3SfSoXDhkboBNyOIzl8SnnMQEaDg9l
         KbHnrYWgXni+TN0WQemZmh2uZc/gtk+pTAw2d7BofKwUazoA7z2XLWIiZn6V6F//KYBR
         hnPjjIqfzmdnh/6dYzP8UPeeUc9BC8R/axzJfC2ib0KRhWhhrvSTG9SaDgT9IQg/FAh7
         Q4hA==
X-Gm-Message-State: AIVw112ktt9EhDuJcUGVKLr/tj5Str4jeyFY3b4y8SJ03tWgCBPeTHBs
	n4aGRoCnj+oV+rbi
X-Received: by 10.25.32.140 with SMTP id g134mr3049101lfg.10.1499710886333;
        Mon, 10 Jul 2017 11:21:26 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.36.84 with SMTP id k81ls20245wmk.0.gmail; Mon, 10 Jul 2017
 11:21:24 -0700 (PDT)
X-Received: by 10.28.135.79 with SMTP id j76mr8736581wmd.27.1499710884572;
        Mon, 10 Jul 2017 11:21:24 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1499710884; cv=none;
        d=google.com; s=arc-20160816;
        b=XjWYoKOJKMt46TDgCcqE61e7VJfcSCyl/HPy1IXASFp+uC4dMRmrzp3c88OaEfxOLu
         BSPLfNJtP4Vwex2tnLH/PSdC30I/q9oC9ZdaO2kwzBV59ZyKAkSx7WoA1TD4sDLwTdN6
         bW6CHIxl+lCxUmevCuhz3pfpBT9vYZsJlBCRrc9wte8w8qGHsxnV9VavmASOKTv9UX+X
         UmXIW/dCCku04y51HRuwa+DyG/C8otn1P8Cyqnx3yLmxF125OGiMU+LsSU8c9OubETpR
         eDEv3F4V25IU0akugagnVXWMeKlZkK8JZwKcVO/4R9sjtqbwaPEZjLLsTmTESePulg/4
         OCcg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=QXRBcgWxRmGgypiYdVJqDGpDUkt0edGc1QmeiWKXfRQ=;
        b=YFqh9AFSIw9F28gFq4vfAKxK3Y3Vj8H/5mUFT5DhiddDFnTcAEw9aV3VuzFGy5vE0M
         usI4WMQal0vC/D6qqWBIuNDA7DbfH7ub++jmfDBAmJslbkyTRf0LIYpn9Pp6kDb8lGiE
         wekVkRd/+lK4Nf/v88UiXX5tAVBwojvPH0IIStaKAIzAQ3E47pNHWxMpboqinJF4dInb
         NKF/BpcGXeXzEMcFZi3K9gvtR/Tk3+S5o9Unp1n/cX0p+hiBZx4HHvYNt8Ck2Z4fHncj
         Od4KAoJx6GSZHX6y58vBrE9xYFjqErD1+EsGjr93aZDungy0BLea5Mzhx1Czf3XyyjQ0
         0fqw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=B+xfaFab;
       spf=pass (google.com: domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c0c::22a as permitted sender) smtp.mailfrom=daniel.kruegler@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com. [2a00:1450:400c:c0c::22a])
        by mx.google.com with ESMTPS id b7si4534845wma.65.2017.07.10.11.21.24
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 10 Jul 2017 11:21:24 -0700 (PDT)
Received-SPF: pass (google.com: domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c0c::22a as permitted sender) client-ip=2a00:1450:400c:c0c::22a;
Original-Received: by mail-wr0-x22a.google.com with SMTP id 77so149608504wrb.1
        for <std-proposals@isocpp.org>; Mon, 10 Jul 2017 11:21:24 -0700 (PDT)
X-Received: by 10.28.132.13 with SMTP id g13mr8837397wmd.58.1499710884063;
 Mon, 10 Jul 2017 11:21:24 -0700 (PDT)
Original-Received: by 10.28.134.16 with HTTP; Mon, 10 Jul 2017 11:21:23 -0700 (PDT)
In-Reply-To: <e45d0f40-ac12-4df3-9532-8c9481e7791a@isocpp.org>
X-Original-Sender: daniel.kruegler@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.b=B+xfaFab;       spf=pass (google.com: domain of
 daniel.kruegler@gmail.com designates 2a00:1450:400c:c0c::22a as permitted
 sender) smtp.mailfrom=daniel.kruegler@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:33164
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33164>

2017-07-10 19:47 GMT+02:00  <gafunchal@gmail.com>:
> Hi,
>
> I propose to add to <iterator>:

[..]

> 2) std::make_const_iterator(iterator)
> Semantics: return iterator static_cast-ed to const_iterator
> Why: We have std::make_move_iterator so again I believe this is missing.
> Container requirements (23.2) specify that iterators must be convertible to
> const_iterator so I believe this is just a static_cast.
>
> 3) std::container_of_t<decltype(iterator)>
> Semantics: determine the container type of the iterator
> Why: Helpful to implement 2 above, also helpful in a variety of situations
> where there's a need to check requirements on the container of an iterator.

These two proposals make assumptions that are neither met by current
implementations nor implied by the standard: There is no 1:1 relation
between container type and iterator type, which makes both (2) and (3)
impossible. It would also break non-Standard-Library implementations
of containers such as from Boost or other third-party libraries.

- 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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAGNvRgBnrZXiiQQy_8eVukE-F365uuXgwFMffvdNbyJ%2B_S%3DO2g%40mail.gmail.com.

.
