220 33176 <74994441.Y8ukuuY6jn@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Add a few missing things from the iterator library
Date: Tue, 11 Jul 2017 23:27:43 -0700
Lines: 62
Approved: news@gmane.org
Message-ID: <74994441.Y8ukuuY6jn@tjmaciei-mobl1>
References: <e45d0f40-ac12-4df3-9532-8c9481e7791a@isocpp.org> <6e2d133b-1c0a-49a9-ae2b-98d82d3a40d3@isocpp.org> <CAKDaRu+vD5_rbhJw=dcjYC2X4BOHVpgAjb6sM=uGn0QvdzmD3Q@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1499840867 1434 195.159.176.226 (12 Jul 2017 06:27:47 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 12 Jul 2017 06:27:47 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBYUCS7FQKGQEKDNL3VY@isocpp.org Wed Jul 12 08:27:43 2017
Return-path: <std-proposals+bncBCB4TK757YBRBYUCS7FQKGQEKDNL3VY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wr0-f200.google.com ([209.85.128.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBYUCS7FQKGQEKDNL3VY@isocpp.org>)
	id 1dVB7e-00005J-SU
	for gclcip-std-proposals@m.gmane.org; Wed, 12 Jul 2017 08:27:42 +0200
Original-Received: by mail-wr0-f200.google.com with SMTP id v88sf3166891wrb.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 11 Jul 2017 23:27:48 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1499840868; cv=pass;
        d=google.com; s=arc-20160816;
        b=Vi3+dHl7otfm3TJ5kdjU0JX4cJ3z/Y0G6fXEqBoLeQFrMOokC1YYlCETRVaLte9B8n
         KMuTEe5y++vYRmi4blm2VxaWZrYFG++TmENqOkVLXqrQHDG770pUxKVoRbDZfhUycH0f
         qo72DwCvNX7x1lHOyop91UtwUjIrTRZ44X1zMeWBeWpw1QEziyMIb4a/ziU7J4p27VU8
         Yvj87sBT6HMOvpwp0vTOCUVsEFMkIPGRlMnwU/wGVnag/4tIJoayl9mJ2+HbdyTHnkND
         p/U32WGr8H+QwPAHpgcx7PqPYvgxHpQuIgenY660mV5DTMZkDU0zeTVJf17T4LkZfinF
         LZ6g==
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:content-transfer-encoding
         :mime-version:references:in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=qgVaZn63d72ajITXlZzdrISOHhZRZuAMV6hve90xhx4=;
        b=j9vqg1YFc/pYLe+YXwdzcQveLu7dbFIPXNIR5CH12alB7Bvz+67yVP7pxCWQU0BqnR
         IbK7D/F4WXQ6AixyEEQ+M1TQUFM/A64hTE62Jns+siT800ToaiJRLV6iGaajnLEOF6O0
         +EnqW5rSmYPf4UYKHVpp9eqySznOz3gXWo7ve57Kzow7lV59/bxJPIlVYD3i9LME/chD
         jn/v54+HvQJVG8HIEody2rEsBGn20cKO2URTiPjflVl6yK66udhYUhSiDspc5BQ51Vvy
         8ZeGHnUt87vppzoBj1dDmd54jk8hQmC1Jf/0T73U2xNs9Ewd81m0jdRfSHyPjDnC9l7k
         CI1A==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) smtp.mailfrom=thiago@macieira.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:in-reply-to:references:mime-version
         :content-transfer-encoding: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=qgVaZn63d72ajITXlZzdrISOHhZRZuAMV6hve90xhx4=;
        b=2DMyu+2PoHJiYX+ee92WkSWSVIYw39FjVNN5z+K4llpuLNE2V02DiX62HLE+lY7X+j
         WiiWvz7yPBlmY1FRMnc9lA17m+BHV0Rhs6qCu9n+hvmmDHKALkSIpT8YGGYMgRagaiNR
         dztaam9bbvqTN82IUCN67b1vQMtMEiVat3VHRAkJVmwYGA8Moms6+2PUsihV8iPw1EED
         vLCzHUtzaJZ8inwDa3ssuoMhjk4tpszTBKmM9gASh9ZnOEmXDSH7m1zH7HTBtJWhkA/3
         zCl3bDbEL/vvidTROrHEdTlvdftLahgmlsQBO/BFFyWVijJpvY1eeaR8tRqvRgCW201u
         JiSA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
         :references:mime-version:content-transfer-encoding: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=qgVaZn63d72ajITXlZzdrISOHhZRZuAMV6hve90xhx4=;
        b=nN8rmZ0StXZbqlObtRMZCeOcCxrzXHH0knwSR6+5ntI26U9jQqLNjiepOsZJRCCSlA
         IdJz0E0vsNtBJqG0SLxHMTrdSdPE9rmoeXAWHn8QbuMVQN2WWEqvd3o7Ny/d3y7iEann
         BlLw0KoQqhOOxPRoEbJnwFaXqOZ9OG/HXJjsimXUrjeRZwXi8sMC6brBMjJEDuyxQoFR
         Kxn9UPa5rD4+MCOZ0hurc+OsboOPKPY5RFWidbPzWLhMidXJQxbjDihcyYgJt5WQH3RV
         uw9pinM3o8ea3BaZ5NncnZIZGZczIkKyLYht2ciWTJUF65TCaWa7P7T+AhEYNRdkyJG/
         kfq 
X-Gm-Message-State: AIVw111el4vcmRSHT7bHq7f6SVGMnFaWAt6rf8x3wXUVC+P/s/wfO03q
	3KPBYxXzaZel1ttH
X-Received: by 10.28.148.23 with SMTP id w23mr146203wmd.0.1499840868087;
        Tue, 11 Jul 2017 23:27:48 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.199.9 with SMTP id x9ls165555wmf.8.gmail; Tue, 11 Jul 2017
 23:27:46 -0700 (PDT)
X-Received: by 10.28.131.202 with SMTP id f193mr1091231wmd.89.1499840866511;
        Tue, 11 Jul 2017 23:27:46 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1499840866; cv=none;
        d=google.com; s=arc-20160816;
        b=B0Bp/A6atJyDSg+DEZkTQnaTEYEtJaGjTvqS//vtOjC6O4sYh/KhLf3dRadH47vOZ4
         a8XbFJvm32eCGSW8EXhFyGp+VxN7TblGdCQ7uWjNcTMCYt7xxkFvTUAfcOS54DPuzg3+
         6uJA4HkGt0tK9L4Zxfeq6IWuizgQ+yDOFgDyY9M0eflz5Okm99KdogNQVAeWk9HESdM7
         0cmqwtnFT604nA3vxo/mn0d/HF8Q1/mOkzC8qxRZjsMMQdmgMcRwF9u6AY5q6/ADIoaJ
         YSroutPILakJalVOir/MxBA3soLpEbyafBqwVouDarGzKQwXQYcScqt/kg5rKGV0ca40
         ekJQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:arc-authentication-results;
        bh=KHErI5Cn1+KaoCD4DI9t079ceeTFpJXSs7NyyCduI5k=;
        b=eZtJGR74dZAWkNMyIov5hZWDObsREFfE42loST43Df5smigf3dV82owd2Gpi6fd6oK
         mfQM/ajsSbM6enJ4JRfl8fxXqXeQ1mNPAg35rOtJeeOB8CnbBOf2kSzrsKyG4L/FmiEa
         4Ln96UWL4TR8JBoKgD+lOhU/TF9KNKeASRYjlMGZWGCJUbZ0V8jHRzQs6cKCz6V88JNm
         JNNQSTc5yi4RREay8eJeGIn5Zu1T7qEOBE45xAuRkj8uT5OJf2qp1wiJKet82CuU0WMC
         UbdpW7Rn/055YFOj/Ub6L7N9jOSxRbt70KQwf/Q8F39nfck4cWT1rfv43ErgvqdSUJed
         k0Pw==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) smtp.mailfrom=thiago@macieira.org
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id g204si1353396wma.58.2017.07.11.23.27.46
        for <std-proposals@isocpp.org>;
        Tue, 11 Jul 2017 23:27:46 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl1.localnet (unknown [IPv6:2601:1c0:4501:5f9f:95eb:2c54:99bc:1ab])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 97B4411A817
	for <std-proposals@isocpp.org>; Tue, 11 Jul 2017 23:27:45 -0700 (PDT)
In-Reply-To: <CAKDaRu+vD5_rbhJw=dcjYC2X4BOHVpgAjb6sM=uGn0QvdzmD3Q@mail.gmail.com>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mailfrom=thiago@macieira.org
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:33176
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33176>

On ter=C3=A7a-feira, 11 de julho de 2017 13:09:09 PDT Giovanni Funchal wrot=
e:
> Thanks Thiago, Nicol, those are some very good points and I now think lik=
e
> you that (3) was a bad idea, but I still think proposals (1) and (2) migh=
t
> make sense to propose as additions.

Why? What value does it give?

> > Just try:
> This works:
>=20
> void f(std::unordered_map<int, int>::const_iterator) {}
> void g(std::unordered_map<int, int>::iterator it)
> {
>     f(static_cast<std::unordered_map<int, int>::const_iterator>(it));
> }

Sorry, that is not what I meant.

Let me rewrite:
void f(std::unordered_map<int, int>::const_iterator) {}

template <typename ForwardIterator>
void g(ForwardIterator it)
{
	f(std::make_const(it));
}

void h()
{
	std::unordered_map<int, int> m;
	g(m.begin());
}

Please write std::make_const such that the code above works.

> Granted it is not trivial to implement std::make_const_iterator so that i=
t
> deduces the type to cast to, but I think disregarding implementation for
> one second that this just points out how useful this feature would be if
> g() needed a const_iterator for whatever reason, exactly because a
> const_iterator is not a const iterator.

Please give us a couple of those "whatever reasons". Let's say at least 5=
=20
distinct use-cases.

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

--=20
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 e=
mail 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/74994441.Y8ukuuY6jn%40tjmaciei-mobl1.

.
