220 19254 <b5273848-aef0-407f-8aa6-e07a9ae9ac8c@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: inkwizytoryankes@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Overloading std::begin and std::end for std::pair
Date: Fri, 24 Jul 2015 14:13:38 -0700 (PDT)
Lines: 399
Approved: news@gmane.org
Message-ID: <b5273848-aef0-407f-8aa6-e07a9ae9ac8c@isocpp.org>
References: <012fd35d-96fd-4775-835e-2105176c4f97@isocpp.org>
 <e61080cb-ca1f-4426-a6be-4618ffe88cfe@isocpp.org>
 <792fab39-5af7-4d95-b9ba-a5cc4aed8544@isocpp.org>
 <8100167.A1Y3soRlXn@tjmaciei-mobl4>
 <15e678b3-9b6b-4966-a7a5-1d37495fda5e@isocpp.org>
 <CAMSC8GNY-CQ+=nD59acZ6-qWbmNK5Fh2JjOHOq6ekxeeG3Lmdg@mail.gmail.com>
 <d8e0f792-23ba-4555-9910-00bd87d6e1ca@isocpp.org>
 <9c360e55-9315-4585-9402-a813a4765e8d@isocpp.org>
 <dcbc314d-a2a4-4afe-a80d-4125d1835a2f@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1078_853807004.1437772419047"
X-Trace: ger.gmane.org 1437772429 16428 80.91.229.3 (24 Jul 2015 21:13:49 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 24 Jul 2015 21:13:49 +0000 (UTC)
Cc: sasha2048@gmail.com, vlad.moscow@mail.ru
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDDLTAGNTIBBBBGVZKWQKGQEZ7CLSTI@isocpp.org Fri Jul 24 23:13:44 2015
Return-path: <std-proposals+bncBDDLTAGNTIBBBBGVZKWQKGQEZ7CLSTI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qg0-f71.google.com ([209.85.192.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDDLTAGNTIBBBBGVZKWQKGQEZ7CLSTI@isocpp.org>)
	id 1ZIkHl-0000jY-Sz
	for gclcip-std-proposals@m.gmane.org; Fri, 24 Jul 2015 23:13:42 +0200
Original-Received: by qgy5 with SMTP id 5sf36557899qgy.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 24 Jul 2015 14:13:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:content-type: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=W/FCrSB5/NUEHD+FXqh1OIEae6P80v2rntMicqug/Rg=;
        b=NRjJLWKBeL53jQ8+f0klOVSUNUWUa8xz2yoqzZbdT5mrJNWuK038TtZkLJBswywjVL
         CrKe9qYh2woNEiV7RSFIgLZ2NIwbn4r9rFPojdvfqjzOhe6w0ajDshRrcUFEmZhXAIcg
         J6qc/PcN3M+CjZMMaz2b52pToFBwYxa1jugZwcQ3O35PGCuHANLfwW2YnoymSTRkFV40
         1eVNhXynWRzq9qkvz56oUlVWurPTIwuu+cPVUDTLPqBMNZ7NqgpSxdcGkr3fN3m+lUNm
         Grkpll1uSSb4bm7cOr/Uc69EgciQpBUxXOwEIFVx2NN4UUGdaI7hKi1fE5Yw/TjQBweY
         29WA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:content-type: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=W/FCrSB5/NUEHD+FXqh1OIEae6P80v2rntMicqug/Rg=;
        b=CfBkDdRhqgl82Lb7M164Cc88SwC44S3bZs9EndK+JfeN8KW4G9eJB7VrH4U/SlaStU
         2BwIyAsovNPaVtlR/MOE/YLjGQrrUZuI9Uty5KLta87wrOWIJw+Nj6U1903MaDnmYZ7m
         CNVlBOAoeUV2GS8qKgnqxWkP04kvFqbje0QbyoSifTfqvZZaYHPjkHW+kWmAgE323IiC
         ARdqHfNfBxIPe5RR8J7WSbvstn394dF08Mp6R6nbW0bRd8pB/d5v662ywRVU9WFJDPSc
         jCig8bVPvlhRGOOMD1NHIJVmYpZpdoJFLF8c7tOLhNuHnyptg0AYwmenO6Df1EgDwp7y
         7o3A==
X-Gm-Message-State: ALoCoQmfWsqzFKtdmBFQ/kGxPNBtsaW7OkZ/X1KqX6k5BFST2QP2D88/Rsm/sELk4CfpTHskv3ez
X-Received: by 10.52.72.102 with SMTP id c6mr15919920vdv.12.1437772420948;
        Fri, 24 Jul 2015 14:13:40 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.93.33 with SMTP id c30ls1749949qge.42.gmail; Fri, 24 Jul
 2015 14:13:39 -0700 (PDT)
X-Received: by 10.140.99.83 with SMTP id p77mr190834qge.3.1437772419779;
        Fri, 24 Jul 2015 14:13:39 -0700 (PDT)
In-Reply-To: <dcbc314d-a2a4-4afe-a80d-4125d1835a2f@isocpp.org>
X-Original-Sender: inkwizytoryankes@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:19254
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19254>

------=_Part_1078_853807004.1437772419047
Content-Type: multipart/alternative; 
	boundary="----=_Part_1079_1425436621.1437772419053"

------=_Part_1079_1425436621.1437772419053
Content-Type: text/plain; charset=UTF-8


Pointers can made range, but they have `begin` and `end`? no. Because most 
of them don't made any range. Can you point me std class that have `begin` 
and `end` but they don't made range?

Over all what do you want is implicit conversation form pair to range. This 
is exactly same situation that conversation form int to enum.
I know usage is right when why I need use cast every time? Its for making 
you remember that not every int can map to enum.

Another approach, do pair have invariants of range? No. You should test 
before each use as range if is range. Who you inform other people that you 
use pair as range?
Using comments? C++ have lot better tools for this. Special classes that 
will enforce it.

int b;
int a;

foo0(&a, &b);
foo1(std::make_pair(&a, &b));
foo2(std::make_range(&a, &b));
With of this functions are call incorrectly? I know that last one for sure 
is broken because I beak invariants of range constructor.
I don't even need to read comments or look on implementation. This is why 
we have `shared_ptr` and `unique_ptr` instead of `T*`.
This classes help us maintaining invariants, you can follow couple of 
simple rules and you will never have problems with memory leaks again.

But with `std::pair` as range is impossible, you can have valid usage of 
pair that aren't ranges in your program. How do you reliable separate both 
usage?
Again use different types for different concepts.






On Friday, July 24, 2015 at 10:06:21 PM UTC+2, Vlad from Moscow wrote:
>
>
>
> On Friday, July 24, 2015 at 9:59:16 PM UTC+3, inkwizyt...@gmail.com wrote:
>>
>> If some object have `begin` and `end` then its range. Most pair aren't 
>> ranges then they should not have this functions.
>>
>
> Most pointers are not ranges. Does it mean that pointers can not make up a 
> range? 
>
> Consider for example a dynamically allocated array. Does it has a range?
>
> How will you specify its range? I think you will specify it as a pair of 
> pointers will not you? So for example if you allocated an integer array of 
> size n and the address of the allocated area was stored in pointer a then 
> pair a and a + n set a valid range. How do you specify pairs in C++? I 
> suspect that you use std::pair.
>
> std::pair<int *, int *> range( a, a + n );
>
> or
>
> auto range = std::make_pair( a, a + n );
>
>
> So if you have a pair that specifiers a valid range then you expect this 
> range can be used in for example the for range statement
>
> So it is natural and locgically consistent for example to write
>
> for ( int x : range ) std::cout << x << ' ';
>
> It is a valid record. Why? Because object range defines a valid range. It 
> already exists. There is no need to invent some superconstructions that to 
> convert this valid range in the same valid range, You already have it.
>
> Another example that I showed early is using either algorithm or class 
> methods equal_range. They all return a valid range do not they?
>
> Thus std::pair is an integral part of algorithms and ranges. It is already 
> used to specify a valid range. There is nothing to invent. All you need is 
> to have an access to elements of the ranges they make up. To have an access 
> means that you need to get accfess to the beginning of the range and to the 
> end of the range.
>
> You have such an access simply writing
>
> for ( auto begin = p.first, end = p.second; begin != end; ++begin ) { 
> /*...*/ }
>
> There is no any need to deform algorithms. All you need you already have 
> in your disposal. 
>
> Only instead of 
>
> for ( auto begin = p.first, end = p.second; begin != end; ++begin ) { 
> /*...*/ }
>
> it is better to write
>
> for ( x : p ) { /(...*/ }
>
> However according to your logic you prefer to use only this record of the 
> loop
>
> for ( auto begin = p.first, end = p.second; begin != end; ++begin ) { 
> /*...*/ }
>
> Why? Because your argument is that std::pair does not set a range.:) It is 
> funny.:) 
>
> I am sorry I do not see any logic in your words. 
>
> Of course you can create a class that will be named something like 
> ranges.  You can even to build a hierarchy of such classes and numerous 
> specializations of the classes. :)
>
> But to use the range that is held in an object of type std::pair your 
> classes are useless.
>
> All examples of code that I showed in this thread I wrote literally in 
> 5-10 minutes without inventing any classes. Because it is natural way of 
> using std::pair having a range.
>
> On the other hand your hierarchy of classes of ranges has been created if 
> I am not mistaken already several years. And in the examples I showed their 
> usage is no more than the usage of soap bubbles. 
>
>  
>
>> If some objects don't give you guarantees about something but you know in 
>> some cases it true then proper way of use is EXPLICITLY show that it hold 
>> true.
>> In our case `std::make_range` fulfill this requirements.
>>
>> Probably solution for this problem are tagged pairs and tuples (IIRC they 
>> are form range proposition).
>> It look something like that:
>>
>> extern int tab[10];
>>
>> std::pair<std::begin_tag<int*>, std::end_tag<int*>> a;
>> std::pair<std::ptr_tag<int*>, std::success_tag<bool>> b;
>>
>> a.begin() = tab; //equal a.first = tab;
>> a.end() = tab + 10; //equal a.second = tab + 10;
>> for (auto& x : a)
>> {
>>     if (x == 5)
>>     {
>>         b.ptr() = &x;
>>         b.success() = true;
>>     }
>> }
>> return b;
>>
>>

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_1079_1425436621.1437772419053
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><br></div><div>Pointers can made range, but they have=
 `begin` and `end`? no. Because most of them don&#39;t made any range. Can =
you point me std class that have `begin` and `end` but they don&#39;t made =
range?<br><br>Over all what do you want is implicit conversation form pair =
to range. This is exactly same situation that conversation form int to enum=
..<br>I know usage is right when why I need use cast every time? Its for mak=
ing you remember that not every int can map to enum.<br><br>Another approac=
h, do pair have invariants of range? No. You should test before each use as=
 range if is range. Who you inform other people that you use pair as range?=
<br>Using comments? C++ have lot better tools for this. Special classes tha=
t will enforce it.<br><div class=3D"prettyprint" style=3D"background-color:=
 rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid;=
 border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><di=
v class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">int</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> b<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><br=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><code class=3D"p=
rettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">int</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span></code>foo0</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(&amp;</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">a</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">b</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br>foo1</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(</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">make_pair</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">(&amp;</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">a</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">b</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">));</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br>foo2</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">std=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">make_range</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">(&amp;</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify">a</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">b</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">));</span></div></code></div>With of this functions are call in=
correctly? I know that last one for sure is broken because I beak invariant=
s of range constructor.<br>I don&#39;t even need to read comments or look o=
n implementation. This is why we have `shared_ptr` and `unique_ptr` instead=
 of `T*`.<br>This classes help us maintaining invariants, you can follow co=
uple of simple rules and you will never have problems with memory leaks aga=
in.<br><br>But with `std::pair` as range is impossible, you can have valid =
usage of pair that aren&#39;t ranges in your program. How do you reliable s=
eparate both usage?<br>Again use different types for different concepts.<br=
><br><br><br><br></div><br><br>On Friday, July 24, 2015 at 10:06:21 PM UTC+=
2, Vlad from Moscow wrote:<blockquote class=3D"gmail_quote" style=3D"margin=
: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div=
 dir=3D"ltr"><br><br>On Friday, July 24, 2015 at 9:59:16 PM UTC+3, <a>inkwi=
zyt...@gmail.com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);bor=
der-left-width:1px;border-left-style:solid"><div dir=3D"ltr">If some object=
 have `begin` and `end` then its range. Most pair aren&#39;t ranges then th=
ey should not have this functions.<br></div></blockquote><div><br></div><di=
v>Most pointers are not ranges. Does it mean that pointers can not make up =
a range? </div><div><br></div><div>Consider for example a dynamically alloc=
ated array. Does it has a range?</div><br></div></blockquote><blockquote cl=
ass=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px =
#ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div></div><div>How will yo=
u specify its range? I think you will specify it as a pair of pointers will=
 not you? So for example if you allocated an integer array of size n and th=
e address of the allocated area was stored in pointer=C2=A0a then pair=C2=
=A0a and=C2=A0a + n set a valid range. How do you specify pairs in C++? I s=
uspect that you use std::pair.</div><div><br></div><div>std::pair&lt;int *,=
 int *&gt; range( a, a + n );</div><div><br></div><div>or</div><div><br></d=
iv><div>auto range =3D std::make_pair( a, a + n );</div><div><br></div><div=
><br></div><div>So if you have a pair that specifiers a valid range then yo=
u expect this range can be used in for example the for range statement</div=
><div><br></div><div>So it is natural and locgically consistent for example=
 to write</div><div><br></div><div>for ( int x :=C2=A0range ) std::cout &lt=
;&lt; x &lt;&lt; &#39; &#39;;</div><div><br></div><div>It is a valid record=
.. Why? Because=C2=A0object range defines a valid range. It already exists. =
There is no need to invent some superconstructions that to convert this val=
id range in the same valid range, You already have it.</div><div><br></div>=
<div>Another example that I showed early is using either algorithm or class=
 methods equal_range. They all return a valid range do not they?</div><div>=
<br></div><div>Thus std::pair is an integral part of algorithms and ranges.=
 It is already used to specify a valid range. There is nothing to invent. A=
ll you need is to have an access to elements of the ranges they make up. To=
 have an access means that you need to get accfess to the beginning of the =
range and to the end of the range.</div><div><br></div><div>You have such a=
n access simply writing</div><div><br></div><div>for ( auto begin =3D p.fir=
st, end =3D p.second; begin !=3D end; ++begin ) { /*...*/ }</div><div><br><=
/div><div>There is no any need to deform algorithms.=C2=A0All you need you =
already have in your disposal.=C2=A0</div><div><br></div><div>Only instead =
of </div><div><br></div><div><div>for ( auto begin =3D p.first, end =3D p.s=
econd; begin !=3D end; ++begin ) { /*...*/ }</div><div><br></div><div>it is=
 better to write</div><div><br></div><div>for ( x : p ) { /(...*/ }</div><d=
iv><br></div><div>However according to your logic you prefer to use only=C2=
=A0this=C2=A0record of the loop</div><div><br></div><div><div>for ( auto be=
gin =3D p.first, end =3D p.second; begin !=3D end; ++begin ) { /*...*/ }</d=
iv><div><br></div><div>Why? Because your argument is that std::pair does no=
t set a range.:) It is funny.:)=C2=A0</div><div><br></div><div>I am sorry I=
 do not see any logic in your words. </div><div><br></div><div>Of course yo=
u can create a class that will be named something=C2=A0like ranges.=C2=A0 Y=
ou can even to build a hierarchy of such classes and numerous specializatio=
ns of the classes. :)</div><div><br></div><div>But to use the range that is=
 held in an object of type std::pair your classes are useless.</div><div><b=
r></div><div>All examples of code that I showed in this thread I wrote lite=
rally in 5-10 minutes without inventing any classes. Because it is natural =
way of using std::pair having a range.</div><div><br></div><div>On the othe=
r hand your hierarchy of classes of ranges has been created if I am not mis=
taken already several years. And in the examples I showed their usage is no=
 more than the usage of soap bubbles. </div><div><br></div><div>=C2=A0</div=
></div></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px =
0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width=
:1px;border-left-style:solid"><div dir=3D"ltr">If some objects don&#39;t gi=
ve you guarantees about something but you know in some cases it true then p=
roper way of use is EXPLICITLY show that it hold true.<br>In our case `std:=
:make_range` fulfill this requirements.<br><br>Probably solution for this p=
roblem are tagged pairs and tuples (IIRC they are form range proposition).<=
br>It look something like that:<br><div style=3D"border:1px solid rgb(187,1=
87,187);background-color:rgb(250,250,250)"><code><div><span style=3D"color:=
rgb(0,0,0)"><br></span><span style=3D"color:rgb(0,0,136)">extern</span><spa=
n style=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb(0,0,136)">int=
</span><span style=3D"color:rgb(0,0,0)"> tab</span><span style=3D"color:rgb=
(102,102,0)">[</span><span style=3D"color:rgb(0,102,102)">10</span><span st=
yle=3D"color:rgb(102,102,0)">];</span><span style=3D"color:rgb(0,0,0)"><br>=
<br>std</span><span style=3D"color:rgb(102,102,0)">::</span><span style=3D"=
color:rgb(0,0,0)">pair</span><span style=3D"color:rgb(102,102,0)">&lt;</spa=
n><span style=3D"color:rgb(0,0,0)">std</span><span style=3D"color:rgb(102,1=
02,0)">::</span><span style=3D"color:rgb(0,0,0)">begin_tag</span><span styl=
e=3D"color:rgb(102,102,0)">&lt;</span><span style=3D"color:rgb(0,0,136)">in=
t</span><span style=3D"color:rgb(102,102,0)">*&gt;,</span><span style=3D"co=
lor:rgb(0,0,0)"> std</span><span style=3D"color:rgb(102,102,0)">::</span><s=
pan style=3D"color:rgb(0,0,0)">end_tag</span><span style=3D"color:rgb(102,1=
02,0)">&lt;</span><span style=3D"color:rgb(0,0,136)">int</span><span style=
=3D"color:rgb(102,102,0)">*&gt;&gt;</span><span style=3D"color:rgb(0,0,0)">=
 a</span><span style=3D"color:rgb(102,102,0)">;</span><span style=3D"color:=
rgb(0,0,0)"><br>std</span><span style=3D"color:rgb(102,102,0)">::</span><sp=
an style=3D"color:rgb(0,0,0)">pair</span><span style=3D"color:rgb(102,102,0=
)">&lt;</span><span style=3D"color:rgb(0,0,0)">std</span><span style=3D"col=
or:rgb(102,102,0)">::</span><span style=3D"color:rgb(0,0,0)">ptr_tag</span>=
<span style=3D"color:rgb(102,102,0)">&lt;</span><span style=3D"color:rgb(0,=
0,136)">int</span><span style=3D"color:rgb(102,102,0)">*&gt;,</span><span s=
tyle=3D"color:rgb(0,0,0)"> std</span><span style=3D"color:rgb(102,102,0)">:=
:</span><span style=3D"color:rgb(0,0,0)">success_tag</span><span style=3D"c=
olor:rgb(0,136,0)">&lt;bool&gt;</span><span style=3D"color:rgb(102,102,0)">=
&gt;</span><span style=3D"color:rgb(0,0,0)"> b</span><span style=3D"color:r=
gb(102,102,0)">;</span><span style=3D"color:rgb(0,0,0)"><br><br>a</span><sp=
an style=3D"color:rgb(102,102,0)">.</span><span style=3D"color:rgb(0,0,136)=
">begin</span><span style=3D"color:rgb(102,102,0)">()</span><span style=3D"=
color:rgb(0,0,0)"> </span><span style=3D"color:rgb(102,102,0)">=3D</span><s=
pan style=3D"color:rgb(0,0,0)"> tab</span><span style=3D"color:rgb(102,102,=
0)">;</span><span style=3D"color:rgb(0,0,0)"> </span><span style=3D"color:r=
gb(136,0,0)">//equal a.first =3D tab;</span><span style=3D"color:rgb(0,0,0)=
"><br>a</span><span style=3D"color:rgb(102,102,0)">.</span><span style=3D"c=
olor:rgb(0,0,136)">end</span><span style=3D"color:rgb(102,102,0)">()</span>=
<span style=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb(102,102,0=
)">=3D</span><span style=3D"color:rgb(0,0,0)"> tab </span><span style=3D"co=
lor:rgb(102,102,0)">+</span><span style=3D"color:rgb(0,0,0)"> </span><span =
style=3D"color:rgb(0,102,102)">10</span><span style=3D"color:rgb(102,102,0)=
">;</span><span style=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb=
(136,0,0)">//equal a.second =3D tab + 10;</span><span style=3D"color:rgb(0,=
0,0)"><br></span><span style=3D"color:rgb(0,0,136)">for</span><span style=
=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb(102,102,0)">(</span>=
<span style=3D"color:rgb(0,0,136)">auto</span><span style=3D"color:rgb(102,=
102,0)">&amp;</span><span style=3D"color:rgb(0,0,0)"> x </span><span style=
=3D"color:rgb(102,102,0)">:</span><span style=3D"color:rgb(0,0,0)"> a</span=
><span style=3D"color:rgb(102,102,0)">)</span><span style=3D"color:rgb(0,0,=
0)"><br></span><span style=3D"color:rgb(102,102,0)">{</span><span style=3D"=
color:rgb(0,0,0)"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136=
)">if</span><span style=3D"color:rgb(0,0,0)"> </span><span style=3D"color:r=
gb(102,102,0)">(</span><span style=3D"color:rgb(0,0,0)">x </span><span styl=
e=3D"color:rgb(102,102,0)">=3D=3D</span><span style=3D"color:rgb(0,0,0)"> <=
/span><span style=3D"color:rgb(0,102,102)">5</span><span style=3D"color:rgb=
(102,102,0)">)</span><span style=3D"color:rgb(0,0,0)"><br>=C2=A0 =C2=A0 </s=
pan><span style=3D"color:rgb(102,102,0)">{</span><span style=3D"color:rgb(0=
,0,0)"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 b</span><span style=3D"color:rgb(102=
,102,0)">.</span><span style=3D"color:rgb(0,0,0)">ptr</span><span style=3D"=
color:rgb(102,102,0)">()</span><span style=3D"color:rgb(0,0,0)"> </span><sp=
an style=3D"color:rgb(102,102,0)">=3D</span><span style=3D"color:rgb(0,0,0)=
"> </span><span style=3D"color:rgb(102,102,0)">&amp;</span><span style=3D"c=
olor:rgb(0,0,0)">x</span><span style=3D"color:rgb(102,102,0)">;</span><span=
 style=3D"color:rgb(0,0,0)"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 b</span><span s=
tyle=3D"color:rgb(102,102,0)">.</span><span style=3D"color:rgb(0,0,0)">succ=
ess</span><span style=3D"color:rgb(102,102,0)">()</span><span style=3D"colo=
r:rgb(0,0,0)"> </span><span style=3D"color:rgb(102,102,0)">=3D</span><span =
style=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb(0,0,136)">true<=
/span><span style=3D"color:rgb(102,102,0)">;</span><span style=3D"color:rgb=
(0,0,0)"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb(102,102,0)">}</s=
pan><span style=3D"color:rgb(0,0,0)"><br></span><span style=3D"color:rgb(10=
2,102,0)">}</span><span style=3D"color:rgb(0,0,0)"><br></span><span style=
=3D"color:rgb(0,0,136)">return</span><span style=3D"color:rgb(0,0,0)"> b</s=
pan><span style=3D"color:rgb(102,102,0)">;</span></div></code></div><br></d=
iv></blockquote></div></blockquote></div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1079_1425436621.1437772419053--
------=_Part_1078_853807004.1437772419047--

.
