220 33163 <e45d0f40-ac12-4df3-9532-8c9481e7791a@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: gafunchal@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Add a few missing things from the iterator library
Date: Mon, 10 Jul 2017 10:47:29 -0700 (PDT)
Lines: 77
Approved: news@gmane.org
Message-ID: <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: multipart/mixed; 
	boundary="----=_Part_6736_310402909.1499708849349"
X-Trace: blaine.gmane.org 1499708854 7293 195.159.176.226 (10 Jul 2017 17:47:34 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 10 Jul 2017 17:47:34 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDLLHL6CZMFBBMP3R3FQKGQEOOLTHMA@isocpp.org Mon Jul 10 19:47:28 2017
Return-path: <std-proposals+bncBDLLHL6CZMFBBMP3R3FQKGQEOOLTHMA@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+bncBDLLHL6CZMFBBMP3R3FQKGQEOOLTHMA@isocpp.org>)
	id 1dUcmM-0001T5-Cs
	for gclcip-std-proposals@m.gmane.org; Mon, 10 Jul 2017 19:47:26 +0200
Original-Received: by mail-pg0-f69.google.com with SMTP id p15sf123392563pgs.7
        for <gclcip-std-proposals@m.gmane.org>; Mon, 10 Jul 2017 10:47:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=bmtXqk6MYOQDIp45AY0yLKPE6tqGJ/1mRoCMDOLsm54=;
        b=TspM6tOsEoiVbI9AaPEsj9TYIjE/E7v7L+HUnqL/WsJDmHTn5tdMuRFrz8f0KpiLXp
         QgRpH+0i4v1mOxHQOnvu1pr3MJVpAh0ivbEZIeCxdHtWc+3gxK9oLsuykcoVLCROruju
         NTVRDjimh41tHnfhICYLTdiQ26HPioTNPmjUcu1qrvCU76uyv4tWaw7MyA7y2h89lNZe
         AnGlTHcXK9wRwJj/i1M8crR2h+yjhkefa7pQ7aCdWkee+7T31jYdkgC/JxTj0Jc8ABLz
         toV0qtd6KJrsaTzxxkRDMfcVOoX7mhNYDWoMup4ZkRt2kWzhTTfTtyn24rpXSU2yX3RC
         2DCQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=bmtXqk6MYOQDIp45AY0yLKPE6tqGJ/1mRoCMDOLsm54=;
        b=J3n9f2tcS+4czj9AcyQ3Kp2kwf5eyP2HF+EHZJ7u8qUVJjcladd2OvlDw9M39+I/6Q
         OTYRzPB1LnGXEpfmtGhOK3QY51wLMVMTJ1q0kfYFe6aeKqw0gA7lXAoyajb+e1YvZieH
         qa9bbqeyJEKYS+reX7hknwx+VbrpSQWCQultneRtdMe8VAB7DAGqEFF+3iyNuns8tfI9
         T25gBlfzPObCQNPh8bwh+7FmZq8zJqKaQ1kwfLnRlFQKIzIi3+nMqk2qozLNZRW7NbSl
         hh/zXyC1dPOHvQAuZJJIYVUD7Il7iXWf1XoWCTtikt8RRDxtKIVw2NzWqLOdyOxBTMS5
         qKgQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=bmtXqk6MYOQDIp45AY0yLKPE6tqGJ/1mRoCMDOLsm54=;
        b=sMFSJpwhDe53lSKHbHz4XZ3Xylo1wBtzk7pvBhY5IZ0MDpfdKkLb5RWGy6ULTrRdmq
         fQ3oR6/vP/n5O0ZQSM7qoXXt3JuOYBwcbhZYImakeeJt5Xgib2pUlRy+c13g52FqAGpr
         WsRiMlWuv3cp74RssJpXMLfbm6uTI0NFeuMXiX1IiFCIYxyzOayI/lHfd3P6pUTmb8DC
         7ySfJbGqAxw7I4+S7i7t6j6D/LIQDbXGl0JcSd6GHFIngepmFeYaAkQxHwjfFcD2QSFF
         C/Wv0YjBA919mk6i+WQxzT8EHkBi5a/ppKUBDHbHVUknGwvmqqDoFlN56oNWP8x8Kf/H
         hjKw==
X-Gm-Message-State: AIVw112LAGEgnAWFBoouBwUqhiwmOozgvH/ojspMBAsZHYGVvUbgNeGg
	3c7OQ/pliGJTrdNv
X-Received: by 10.98.216.134 with SMTP id e128mr10201233pfg.12.1499708851353;
        Mon, 10 Jul 2017 10:47:31 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.86.145 with SMTP id o139ls30123itb.20.gmail; Mon, 10 Jul
 2017 10:47:29 -0700 (PDT)
X-Received: by 10.36.89.7 with SMTP id p7mr483729itb.4.1499708849816;
        Mon, 10 Jul 2017 10:47:29 -0700 (PDT)
X-Original-Sender: gafunchal@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:33163
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33163>

------=_Part_6736_310402909.1499708849349
Content-Type: multipart/alternative; 
	boundary="----=_Part_6737_319643926.1499708849350"

------=_Part_6737_319643926.1499708849350
Content-Type: text/plain; charset="UTF-8"

Hi,

I propose to add to <iterator>:

1) std::mbegin(container)/std::mend
Semantics: Return moveable iterators, exactly the same as 
std::make_move_iterator(std::begin(container))
Why: We already have std::begin and std::cbegin and I believe this is a odd 
one out for consistency

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.

Thanks,
-- Giovanni

-- 
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/e45d0f40-ac12-4df3-9532-8c9481e7791a%40isocpp.org.

------=_Part_6737_319643926.1499708849350
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>I propose to add to &lt;iterator&gt=
;:</div><div><br></div><div>1) std::mbegin(container)/std::mend</div><div>S=
emantics: Return moveable iterators, exactly the same as std::make_move_ite=
rator(std::begin(container))</div><div>Why: We already have std::begin and =
std::cbegin and I believe this is a odd one out for consistency</div><div><=
br></div><div>2) std::make_const_iterator(iterator)</div><div>Semantics: re=
turn iterator static_cast-ed to const_iterator</div><div>Why: We have std::=
make_move_iterator so again I believe this is missing. Container requiremen=
ts (23.2) specify that iterators must be convertible to const_iterator so I=
 believe this is just a static_cast.</div><div><br></div><div>3) std::conta=
iner_of_t&lt;decltype(iterator)&gt;</div><div>Semantics: determine the cont=
ainer type of the iterator</div><div>Why: Helpful to implement 2 above, als=
o helpful in a variety of situations where there&#39;s a need to check requ=
irements on the container of an iterator.</div><div><br></div><div>Thanks,<=
/div><div>-- Giovanni</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/e45d0f40-ac12-4df3-9532-8c9481e7791a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e45d0f40-ac12-4df3-9532-8c9481e7791a=
%40isocpp.org</a>.<br />

------=_Part_6737_319643926.1499708849350--

------=_Part_6736_310402909.1499708849349--

.
