220 33166 <00dbc427-c520-42f8-b92d-6c12d600483f@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Ray Hamel <rayghamel@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 11:35:23 -0700 (PDT)
Lines: 105
Approved: news@gmane.org
Message-ID: <00dbc427-c520-42f8-b92d-6c12d600483f@isocpp.org>
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: multipart/mixed; 
	boundary="----=_Part_1858_869514192.1499711724064"
X-Trace: blaine.gmane.org 1499711737 902 195.159.176.226 (10 Jul 2017 18:35:37 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 10 Jul 2017 18:35:37 +0000 (UTC)
Cc: gafunchal@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDPM7JNEVQJRB3ERR7FQKGQEG3G2U3Q@isocpp.org Mon Jul 10 20:35:25 2017
Return-path: <std-proposals+bncBDPM7JNEVQJRB3ERR7FQKGQEG3G2U3Q@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+bncBDPM7JNEVQJRB3ERR7FQKGQEG3G2U3Q@isocpp.org>)
	id 1dUdWi-0007y2-Qk
	for gclcip-std-proposals@m.gmane.org; Mon, 10 Jul 2017 20:35:21 +0200
Original-Received: by mail-pg0-f69.google.com with SMTP id s4sf124524788pgr.3
        for <gclcip-std-proposals@m.gmane.org>; Mon, 10 Jul 2017 11:35:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=RlG3ctmZHFLnsvuXNhNxyjvJC9xwlEeiZxvNaCwfqas=;
        b=cWQjzZcM/KEVEsr0ew2lbHGvyOJfkcxN/8TkbvNcH4LgesYiddltbMrEuWtkzWgx1R
         cVwGwphG//RH4PxN3QsNbBFEl+0hIdhlb2FV1vVS2Vnrrhbzp4UmM1xe+AKwvnLO4QPR
         jo5efcnyWFHBLoiq5OcnAIec7T2c7dBy6mqrYfkVXFDLmBTKjC6gi8Q6dDgafleg4CdY
         MLTANy58h7+Y5ZqTaVvedWj9DD92C2N8AhTHv6st1UuenRWfddzB1HkquuKApL7kJGnV
         TJO/grCq5TZ5h0MRGiYsFmmilikPdygoCgHaj0L1bJmJ3wER4UmqHSsDFWBXsQtHWnjd
         oUCw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=RlG3ctmZHFLnsvuXNhNxyjvJC9xwlEeiZxvNaCwfqas=;
        b=rJoAH9ppmSp6Wyhdw3ZO810n5n2ylzspKlhVvikwb4ArUaerct1cWYjF//5jKaLUzL
         PQ57G8bwc4AfJY0C3PMrsuXGe/BSeehcvMWDnMIDQO1mpC8taGFLVF24LZ51J6MU/Gt/
         IROy/u0XpQmGP7VX6APb/5AbepR9nrutUPg6EJ6RV2wQ13HwE+/JHRdW1qy99IG0h94w
         My/guKwBlXC1PqetzCNy6mq4BBD5iCnOoMR73krhKhzuRKRVPOAQmtOnvEDKM24kjVf9
         IOmHB75N2Fb1XSFPP+cG87JA/3og2bbfeCWhT8FahkUqgMcK/0jCSLu/Yik97gkBt1+d
         cG9A==
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:cc:message-id:in-reply-to
         :references: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=RlG3ctmZHFLnsvuXNhNxyjvJC9xwlEeiZxvNaCwfqas=;
        b=X88TcjqA9TcCu/vEIcXY+Q2tn6Sf83YWFKX7YGL16xlDCwkAFgLjA43XbiM+wqF+XY
         xCA5WUBM8m8b2kFYsPJfieuJ90MrdlcEV/jWaxBrEMh21xBKisQCkiuoPm6Q4G/sKdLY
         rYRVB6PjwqPFUkJQprBh8eJ93Xr/zdqkSB8pKnxIBXzNsRkhdfN79ld5sytZQA8XP7gK
         NFPceg1t6fXwJoFTVtY95lSQDK3qqUMDsXTCXMWcnKSm+73uV36QiJLV0MtLt7ebAk54
         5qjZ8jLYsXeN4/R5RSWnDj0ExjJtiXIK2vavygcqdiY8O//tS4ZzrB0QonxNORvBlIIp
         /r7Q==
X-Gm-Message-State: AIVw112pJeqS3FYNIwO7zoEIDHpee0ZeR7zfgrxDUNR+ifBvyHNAJqI1
	J3s302zpTxG3nJay
X-Received: by 10.98.252.75 with SMTP id e72mr10289781pfh.21.1499711725900;
        Mon, 10 Jul 2017 11:35:25 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.51.212 with SMTP id z203ls84784ioz.53.gmail; Mon, 10 Jul
 2017 11:35:24 -0700 (PDT)
X-Received: by 10.36.29.212 with SMTP id 203mr515556itj.5.1499711724446;
        Mon, 10 Jul 2017 11:35:24 -0700 (PDT)
In-Reply-To: <e45d0f40-ac12-4df3-9532-8c9481e7791a@isocpp.org>
X-Original-Sender: rayghamel@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:33166
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33166>

------=_Part_1858_869514192.1499711724064
Content-Type: multipart/alternative; 
	boundary="----=_Part_1859_1324128622.1499711724064"

------=_Part_1859_1324128622.1499711724064
Content-Type: text/plain; charset="UTF-8"

On Monday, July 10, 2017 at 1:47:29 PM UTC-4, gafu...@gmail.com wrote:
>
> 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.
>

Someone with more knowledge of template metaprogramming and the type system 
than I do needs to weigh in on this, but I'm not sure if this is currently 
possible in ISO C++.

An alternative might be something like

std::container_from_value_type<ValueType, Container=std::vector<ValueType>>
std::container_from_iterator<Iterator,Container=std::vector<std::
remove_pointer_t<Iterator>>

-Ray

-- 
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/00dbc427-c520-42f8-b92d-6c12d600483f%40isocpp.org.

------=_Part_1859_1324128622.1499711724064
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, July 10, 2017 at 1:47:29 PM UTC-4, gafu...@gmai=
l.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px =
0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color:=
 rgb(204, 204, 204); padding-left: 1ex;"><div dir=3D"ltr"><div>3) std::cont=
ainer_of_t&lt;decltype(<wbr>iterator)&gt;</div><div>Semantics: determine th=
e container type of the iterator</div><div>Why: Helpful to implement 2 abov=
e, also helpful in a variety of situations where there&#39;s a need to chec=
k requirements on the container of an iterator.</div></div></blockquote><di=
v><br></div><div>Someone with more knowledge of template metaprogramming an=
d the type system than I do needs to weigh in on this, but I&#39;m not sure=
 if this is currently possible in ISO C++.</div><div><br></div><div>An alte=
rnative might be something like</div><div><br></div><div><div class=3D"pret=
typrint" style=3D"background-color: rgb(250, 250, 250); border: 1px solid r=
gb(187, 187, 187); word-wrap: break-word;"><code class=3D"prettyprint"><div=
 class=3D"subprettyprint"><font color=3D"#660066"><span style=3D"color: #00=
0;" class=3D"styled-by-prettify">std</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">container_from_value_type</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #606;" cl=
ass=3D"styled-by-prettify">ValueType</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-pr=
ettify">Container</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify">vector</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span st=
yle=3D"color: #606;" class=3D"styled-by-prettify">ValueType</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&gt;&gt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>std</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify">container_from_iterator</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"=
color: #606;" class=3D"styled-by-prettify">Iterator</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #606=
;" class=3D"styled-by-prettify">Container</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">std</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">vector</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">s=
td</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">remove_pointer_t=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span=
><span style=3D"color: #606;" class=3D"styled-by-prettify">Iterator</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;&gt;</span></f=
ont></div></code></div></div><br><div>-Ray</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/00dbc427-c520-42f8-b92d-6c12d600483f%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/00dbc427-c520-42f8-b92d-6c12d600483f=
%40isocpp.org</a>.<br />

------=_Part_1859_1324128622.1499711724064--

------=_Part_1858_869514192.1499711724064--

.
