220 33182 <b9b96a13-c0c7-43cc-de3a-e993847f5f8c@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Add a few missing things from the iterator library
Date: Wed, 12 Jul 2017 09:56:22 -0400
Lines: 43
Approved: news@gmane.org
Message-ID: <b9b96a13-c0c7-43cc-de3a-e993847f5f8c@gmail.com>
References: <e45d0f40-ac12-4df3-9532-8c9481e7791a@isocpp.org>
 <6e2d133b-1c0a-49a9-ae2b-98d82d3a40d3@isocpp.org>
 <CAKDaRu+vD5_rbhJw=dcjYC2X4BOHVpgAjb6sM=uGn0QvdzmD3Q@mail.gmail.com>
 <74994441.Y8ukuuY6jn@tjmaciei-mobl1>
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 1499867804 26385 195.159.176.226 (12 Jul 2017 13:56:44 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 12 Jul 2017 13:56:44 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.0
To: std-proposals@isocpp.org, Thiago Macieira <thiago@macieira.org>
Original-X-From: std-proposals+bncBC37LBFWUIFBBDWVTDFQKGQE72LWY2I@isocpp.org Wed Jul 12 15:56:38 2017
Return-path: <std-proposals+bncBC37LBFWUIFBBDWVTDFQKGQE72LWY2I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f69.google.com ([74.125.83.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBDWVTDFQKGQE72LWY2I@isocpp.org>)
	id 1dVI7v-00065o-6x
	for gclcip-std-proposals@m.gmane.org; Wed, 12 Jul 2017 15:56:28 +0200
Original-Received: by mail-pg0-f69.google.com with SMTP id t8sf25466160pgs.5
        for <gclcip-std-proposals@m.gmane.org>; Wed, 12 Jul 2017 06:56:32 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1499867792; cv=pass;
        d=google.com; s=arc-20160816;
        b=kQEXhRwZkgqeosTclk74U6ypUBD+2pzziiAZUag0iyJGoUS5VISV439t27KpfqCMO+
         cmzs14d7Xqu+nPFGYzHU3dM5XqeMyxXMmZ5Dh3M3GXSUAQrXIg8h4/HjRvoZhZefbqs+
         cOG4pqyAuoKg9358uMQwgSiutVhT1Bk8AqSJjYzUDi2517QCK71NLVs3DYvk7FexUwgf
         l39uD6OcAdvuqEjLb6FutQJVWk71jY8F8O/rrFGRUpcpX5TsurwjO4tZLbcsvj1ZBy8I
         Bm9OP4i9YzSFBA63rz7vLyXoPmZykNi+Qrx0Xts6FJ4mmSijmoditAD6czz3BaHVIJU9
         5Prw==
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-language
         :in-reply-to:mime-version:user-agent:date:message-id:from:references
         :newsgroups:to:subject:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=y2SpcC2DOAI2rIqyDdfvRZMO3SLZEa7J8ACJ91h0C0c=;
        b=pHZLwNuvY+58Bc9zvkDWfFbRa3j9Tgt9VHT4yWvka9Gs/K88DUWL/M7ri/mNt4D868
         LSAEqwRfW5gFw0igWocTfkWeB20ElquB74X9uCcZk4AbbmKCIRvuhxbm9bgbQEvGfpu1
         /BQGEJrDFZtPiBw/rKeA0iDd112761Dr4gyW5A3h5A4V5i2lP4rUX3DagmnjudwGfAuK
         +7AejfMofD39/OSH205LvIcB72JuW8kbVA61T3/jw88aSQu68td+XihAzDqyDxIB5GQg
         YO9f5mL2J7e+us6qwAidvBjEERS+dThObRhEWavhUo0VWRaPeonBXLK1r8K5PZlP470M
         
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=L7IlQaKD;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c06::243 as permitted sender) smtp.mailfrom=mwoehlke.floss@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=subject:to:newsgroups:references:from:message-id:date:user-agent
         :mime-version:in-reply-to:content-language: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=y2SpcC2DOAI2rIqyDdfvRZMO3SLZEa7J8ACJ91h0C0c=;
        b=TwPYk8vnmRBC8WUPbeG6Axlz1+8sNc6sAe1KBppg48ZINq9wCs5USprlfQLnMA28Od
         la++fz0mUF3XnA/9farVhPbMtsdrnRdoHq3daruynL9H54aMMYZ9P7uWpLy859prxpjk
         QZqixRr/ZdX0MhAVZXcc5MZuLmbkFQxX8phFhVK/gGCzcL5vZ8nFklxHOaqqTsUWA6j/
         x0h5rry4MmMK0nZ8EyH8ILeRgI4BAZSY3bq6eHi+bWt1f+BW6ISLkueyBPyoa4iuXdIS
         2SBBqxndI9x5mxFX7jRcKMEWnBq1gsSzieH/huyJeJrQywamTkQPwFn2eqgiQasZGK1K
         nAKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:newsgroups:references:from:message-id
         :date:user-agent:mime-version:in-reply-to:content-language
         :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=y2SpcC2DOAI2rIqyDdfvRZMO3SLZEa7J8ACJ91h0C0c=;
        b=EsxoGJhppSL0IIXQ6Dv8u1PbLo2+qKnEdLl2BkD3x1JMzZI3ALczxrLcdPqHJa0+0i
         8M9o4d/8h5UI8Q4rNH21Pmh/RV4wcQ0zhKj2eEaTnjtgws7zk52CpmIOf29mzClbUUuv
         k83ADJ/PxHhZ89P66FLI10mdIYYp82HHskdykBuJDlEnCHxkgy8KpRvuN/E4o1nE8cE8
         rPFnXSaGwTBWIIxDRRZXj9hBove8VtYW+3kfPqnLorDlDZhBeJpgT25j2duT6s2VnllH
         kLO2o4Ro3Wozgya+gG8qgUAkab/MFCZs1Vztv9grD+1H9ThqiotvUOO4j5gzZZlZw31e 
X-Gm-Message-State: AIVw110F/th/nQ2s6rXWHWaBQoXFAIRwXCX+gfZnnL0oerhsWRG4c1eB
	DFLzcso6XrWDbpJS
X-Received: by 10.99.143.73 with SMTP id r9mr2358469pgn.5.1499867792299;
        Wed, 12 Jul 2017 06:56:32 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.86.199 with SMTP id o190ls1582446itb.10.canary-gmail; Wed,
 12 Jul 2017 06:56:30 -0700 (PDT)
X-Received: by 10.36.154.67 with SMTP id l64mr23051677ite.87.1499867790667;
        Wed, 12 Jul 2017 06:56:30 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1499867790; cv=none;
        d=google.com; s=arc-20160816;
        b=PU8RcBYeF8XvbO1VtIgLlVkKt13qeBv1yuCapRFIhYP3SijfwPOkjCsEUs8Fv4Q/jZ
         SRlHTbPpSUixhDNH8c9rKZDLZm2l6qS49JLxkKOY6H9OYyAewfa+LlVKHRpaYnuH9aPk
         KcXcphD/bh35EeZKNJOWB9Ty3c+oW1ZkxhGAxMi+Y5m6r0mTmFZI2G8ZYlL1FdKEcvN6
         ZYf0Un2uq8LByTtqZRj6BYTmmNWzmuodhliup7Y3BUZiGs5LmPErsPVt8zEm83gU9wWh
         7lwUaQkoI3TCZNH24Nom7Q0CkDVaA9XpjjlwACmNSDDuBEm+ZBT/zlfLEphdK9IT3iG/
         34hw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:from:references:newsgroups:to:subject
         :dkim-signature:arc-authentication-results;
        bh=HkCut+WRERn6a7ILESMLkfHL5fdgvEP36Smo2oiOMaE=;
        b=F88IFImXAOOmsMIrcGTJnQ7prm7e8i8YgeS0ZuBwFApAegoz8BWgTBr6wg20ghWvHD
         kPMmk/hbbEeUKCudP9QQDvFQz2fntoDHXQGdf2n2TT//qxjVqDqi6ljAxrt/ZO9RW9Jg
         Ho9wFrE4XrEp8Hf2AanhBgs/WqGeVIxrD12lbES+1kKwE0/cyU2Uf1qCjIEtGMNAY3+d
         lwz1eB/75FLnkU8n7aQWA3uYh+/ir9EQNSzghJ5vjmgrMzt+nDV5+CFWS38LI3YKBLcO
         aHifDww91NXwT+Z8twQZWnNxketp+Tapf6QSTKLUBGznJmwcjBRPlomZvVSYSzsyYZrP
         CLqg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=L7IlQaKD;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c06::243 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-io0-x243.google.com (mail-io0-x243.google.com. [2607:f8b0:4001:c06::243])
        by mx.google.com with ESMTPS id j7si3176325iob.239.2017.07.12.06.56.30
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 12 Jul 2017 06:56:30 -0700 (PDT)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c06::243 as permitted sender) client-ip=2607:f8b0:4001:c06::243;
Original-Received: by mail-io0-x243.google.com with SMTP id f66so2048657iof.1
        for <std-proposals@isocpp.org>; Wed, 12 Jul 2017 06:56:30 -0700 (PDT)
X-Received: by 10.107.48.70 with SMTP id w67mr5181130iow.133.1499867790434;
        Wed, 12 Jul 2017 06:56:30 -0700 (PDT)
Original-Received: from gryphon.kitware.com (tripoint.kitware.com. [66.194.253.20])
        by smtp.googlemail.com with ESMTPSA id m27sm1569555ioi.19.2017.07.12.06.56.29
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 12 Jul 2017 06:56:29 -0700 (PDT)
Original-Newsgroups: gmane.comp.lang.c++.isocpp.proposals
In-Reply-To: <74994441.Y8ukuuY6jn@tjmaciei-mobl1>
Content-Language: en-US
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.b=L7IlQaKD;       spf=pass (google.com: domain of
 mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c06::243 as permitted
 sender) smtp.mailfrom=mwoehlke.floss@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:33182
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33182>

On 2017-07-12 02:27, Thiago Macieira wrote:
> 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.

  template <typename Key, typename Value>
  auto make_const(
    std::__detail::_Node_iterator<std::pair<const Key, Value>,
                                  false, false> iter)
    -> std::__detail::_Node_const_iterator<std::pair<const Key, Value>,
                                           false, false>
  {
    return iter;
  }

....?

Yeah, you need ugly partial specializations / overloads that depend on
implementation details... so what? At worst, there needs to be a type
trait to derive the const_iterator type given the iterator type, or
something along those lines. That doesn't seem fatal...

-- 
Matthew

-- 
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/b9b96a13-c0c7-43cc-de3a-e993847f5f8c%40gmail.com.

.
