220 5240 <e4828fad-0428-46f8-ad6d-500848c2212b@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: asaelr@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Some thoughts about coroutines
Date: Wed, 26 Jun 2013 18:40:58 -0700 (PDT)
Lines: 1405
Approved: news@gmane.org
Message-ID: <e4828fad-0428-46f8-ad6d-500848c2212b@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_2129_3026738.1372297258221"
X-Trace: ger.gmane.org 1372299384 26978 80.91.229.3 (27 Jun 2013 02:16:24 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 27 Jun 2013 02:16:24 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB23LHRZUKRB5OAV2HAKGQEFDXULCQ@isocpp.org Thu Jun 27 04:16:25 2013
Return-path: <std-proposals+bncBCB23LHRZUKRB5OAV2HAKGQEFDXULCQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yh0-f70.google.com ([209.85.213.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB23LHRZUKRB5OAV2HAKGQEFDXULCQ@isocpp.org>)
	id 1Us1l1-00053T-Gv
	for gclcip-std-proposals@m.gmane.org; Thu, 27 Jun 2013 04:16:24 +0200
Original-Received: by mail-yh0-f70.google.com with SMTP id l109sf332485yhq.9
        for <gclcip-std-proposals@m.gmane.org>; Wed, 26 Jun 2013 19:16:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:date:from:to:message-id:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-google-group-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=VSGpw4PdO6xbMcFjfwsgngNlmoO/YXxngLgHdhBknkQ=;
        b=p3zqDWdzUuREild+J9uRNRN/m2g+2ZSk1HCu+Z4GgPgcb5ixULeqDsKshyL8U1VQuy
         2vhOcmTU336jTfwxo73XBLTo/7JsrxMrzCS8mtfAeWNJc0Fp0ztEsnQjzjt1Q6xwzjOP
         uydRNkTR34u44FUY3DefyNXGE5ydBvKuXreBTq1eCpd01JsTALrF0Ysw+4oSjFWrZGWc
         hRtWyVd8kALwGvl8xRikfmPMrO0SkX+6Q3Rlu154bz30Q8NVD2dNZlnV5StRelTx6nOC
         EmVxg3d87LNW/tgxm6HEEYHsKZqlpPBa8nQJ9fMm2aLp9qYJQ0YsQNvE7wG5dAP6vbiC
         Pgtg==
X-Received: by 10.236.54.8 with SMTP id h8mr3629748yhc.11.1372299382706;
        Wed, 26 Jun 2013 19:16:22 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.50.228 with SMTP id f4ls723422qeo.29.gmail; Wed, 26 Jun
 2013 19:16:21 -0700 (PDT)
X-Received: by 10.224.29.76 with SMTP id p12mr5714788qac.5.1372299381119;
        Wed, 26 Jun 2013 19:16:21 -0700 (PDT)
Original-Received: by 10.224.181.75 with SMTP id bx11msqab;
        Wed, 26 Jun 2013 18:40:58 -0700 (PDT)
X-Received: by 10.49.129.104 with SMTP id nv8mr177277qeb.27.1372297258722;
        Wed, 26 Jun 2013 18:40:58 -0700 (PDT)
X-Original-Sender: asaelr@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: <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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:5240
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5240>

------=_Part_2129_3026738.1372297258221
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable



Recently, I=92ve thought a lot about coroutines, and how they should behave=
=20
if became a part of c++.

I found two (main) proposals:

a.=20
https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/3g6ZIWed=
GJ8

It has the advantage of not requiring to change the syntax, but in force a=
=20
new model of stack-based calls. It does so in purpose to let nested=20
functions to yield value, which I think is not really necessary. (If we let=
=20
nested functions return value on behalf of their callee, we should start=20
this in regular functions). Also, Its syntax is somehow complex.

b.=20
https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/PPZJVTDd=
DVQ

It is easy to use and doesn=92t require a new stack, and I think that this =
is=20
the right direction. However, it ignores some technical details (lifetime=
=20
of locals, etc). Also, adding a keyword may break too many working code,=20
and my personal opinion is that it is ugly. Sentences like =93void numbers(=
)=20
yields int=94 reminds me too many things I hate in Java. The alternative=20
syntax (described at the end of this proposal) is not so ugly, but still=20
complex.

There is even a nice implementation of coroutines (using macros):=20
http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

but it has 2 major disadvantages: while using it, we can=92t yield a value=
=20
from within a switch statement, and, much more important, we have to define=
=20
all the local variables at the top of the function - back to C90 days! (and=
=20
with constructors this is much worst.)

Another thing that was very little talk about, is for-range loops native=20
support. Let=92s say we have a Fibonacci number generator (a very common=20
example):

(Using Denis Bredelet=92s proposal syntax)

void fib(int n) yields int {

 int a=3D0,b=3D1;

 while(n--) {

   int c=3Da+b;

   a=3Db;

   b=3Dc;

   yield c;

 }

}

We want the possibility to write for (int i : fib(10)) std::cout<<i<<=92\n=
=92;to print the first 10 Fibonacci numbers.

So what am I suggest?

First, to the syntax. Since we want it to work natively with for-range=20
loops, and since the  language concept is =93declare it the way you will us=
e=20
it=94, I would suggest using colon in the function signature. The nicest id=
ea=20
I managed to think so far is int : fib(int n)

Also, there is no reason to add the keyword yield, when we can stick to=20
good old return.

Now, to the real stuff: What does fib(10) mean? What=92s the type of=20
fib(10).begin()?

I suggest this meaning: fib will be (auto-generated) class, and an object=
=20
of it will represent calling the =93function=94 with specific parameters. T=
he=20
member function begin (and end) will return some sort of iterator, which=20
will represent the actual call.

Some details: the fib class should have some members, to contain the=20
parameters it called with, but the real fun is in the iterator class: it=20
will have (in addition to the parameters),  as (not exactly, I will explain=
=20
below) members, all the local variables of the =93function=94 (including th=
e=20
return value), and also the information about where it stopped last time=20
(and should resume from) - let=92s call it, from now on, =93position data=
=94.

To be more precise: an iterator should contain the memory for the local=20
variables (like every member variable), but their lifetime will be as if=20
they were local variables of the =93function=94. I mean - they will been=20
constructed only when the =93function=94 will decide so, and not automatica=
lly=20
when the iterator is been constructed.

When the =93function=94 ends (either by falling through the ending brace, n=
ot=20
catching exception, or simply saying return; without a value), the position=
=20
data should contain this information, and (like every function), every=20
local variable should be destructed.

Knowing the position data let us easily determine which variables are=20
alive, and so I think that the following member functions can be=20
automatically created:

copy constructor - should copy the position data, the parameters, and every=
=20
living local variable

move constructor - the same, but move instead of copy

destructor - destroy the parameters, and every living local variable.

(Of course, if some local variable is noncopyable, so is the iterator)

I think that it should not be assignable - If one iterator have a live=20
object, and another one have not, it=92s a real mess.

Some example:

Suppose that we want to yield the number 0, and then, the first n Fibonacci=
=20
numbers and the first n even number, alternately. To add more interest (and=
=20
to demonstrate more rules), I want to create and destroy some objects=20
(assume A is a copyable, moveable, and int-constructive class), so I=92ve=
=20
written the following code:

int : fib_even(int n) {

   A a(7);

   int fib1=3D0,fib2=3D1,even=3D0;

   return 0;

   while(n--) {

       int fib3=3Dfib1+fib2;

       fib1=3Dfib2;

       fib2=3Dfib3;

       return fib3;

       A b=3Dn;

       return even+=3D2;

   }

}

A compiler may expand it to something like:

(Note: I=92m using dynamic memory allocation, but It=92s not really how it=
=20
should be implemented - I just don=92t want some constructors and destructo=
rs=20
to been invoked automatically)

class fib_even {

   class iterator {

       int n;

       int *fib1,*fib2,*fib3,*even;

       A *a,*b;

       int *ret_value;

       enum {p0,p1,p2,p3,p4} pos; //resuming points

       void next() {

           switch (pos) {

               case p0: break;

               case p1: goto label1;

               case p2: goto label2;

               case p3: goto label3;

               case p4: return;

           }

//construct automatic variables of the function

           a=3Dnew A(7);

           fib1=3Dnew int(0);

           fib2=3Dnew int(1);

           even=3Dnew int(0);

//the return process - create the value, save the resuming point, and retur=
n

           ret_value=3Dnew int(0);

           pos=3Dp1;

           return;

       label1:

           while(n--) {

               fib3=3Dnew int(*fib1+*fib2); //being constructed only now

               *fib1=3D*fib2;

               *fib2=3D*fib3;

               ret_value=3Dnew int(*fib3);

               pos=3Dp2;

               return;

       label2:

               b=3Dnew A(n);

               ret_value=3Dnew int((*even)+=3D2);

               pos=3Dp3;

               return;

       label3:

//automatic variables going out of scope, and should be destructed

               delete b;

               delete fib3;

           }

           delete even;

           delete fib2;

           delete fib1;

           delete a;

           pos=3Dp4;

       }

       iterator(int n) : n(n),pos(p0) {

           next(); //get the first value

       }

       iterator() : pos(p4) {}

   public:

       iterator &operator++() {

           delete ret_value;

           next();

           return *this;

       }

       int &operator*() {

           return *ret_value;

       }

       iterator(const iterator &it) : n(it.n),pos(it.pos) {

//copy only living members

           if (pos>p0 && pos<p4) {

               ret_value=3Dnew int(*it.ret_value);

               a=3Dnew A(*it.a);

               fib1=3Dnew int(*it.fib1);

               fib2=3Dnew int(*it.fib2);

               even=3Dnew int(*it.even);

           }

           if (pos>p1 && pos<p4) fib3=3Dnew int(*it.fib3);

           if (pos>p2 && pos<p4) b=3Dnew A(*it.b);

       }

       iterator(iterator &&it) : n(std::move(it.n)),pos(it.pos) {

           if (pos>p0 && pos<p4) {

               ret_value=3Dnew int(std::move(*it.ret_value));

               a=3Dnew A(std::move(*it.a));

               fib1=3Dnew int(std::move(*it.fib1));

               fib2=3Dnew int(std::move(*it.fib2));

               even=3Dnew int(std::move(*it.even));

           }

           if (pos>p1 && pos<p4) fib3=3Dnew int(std::move(*it.fib3));

           if (pos>p2 && pos<p4) b=3Dnew A(std::move(*it.b));

       }

       ~iterator() {

           if (pos>p2 && pos<p4) delete b;

           if (pos>p1 && pos<p4) delete fib3;

           if (pos>p0 && pos<p4) {

               delete even;

               delete fib2;

               delete fib1;

               delete a;

               delete ret_value;

           }

       }

       bool operator!=3D(const iterator &it) {

           return pos!=3Dit.pos;

       }

       operator bool() {

           return pos<p4; //still hasn't ended

       }

       iterator &operator=3D(const iterator&) =3D delete;

       friend fib_even;

   };

   int n;

public:

   fib_even(int n) : n(n) {}

   iterator begin() {

       return iterator(n);

   }

   iterator end() {

       return iterator();

   }

};

So, what do you think?

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.



------=_Part_2129_3026738.1372297258221
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"=
 id=3D"docs-internal-guid--bd7c543-833d-2981-81c4-c5055c650915"><span style=
=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transpa=
rent;font-weight:normal;font-style:normal;font-variant:normal;text-decorati=
on:none;vertical-align:baseline;">Recently, I=92ve thought a lot about coro=
utines, and how they should behave if became a part of c++.</span></p><p di=
r=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><spa=
n style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:=
transparent;font-weight:normal;font-style:normal;font-variant:normal;text-d=
ecoration:none;vertical-align:baseline;">I found two (main) proposals:</spa=
n></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom=
:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgr=
ound-color:transparent;font-weight:normal;font-style:normal;font-variant:no=
rmal;text-decoration:none;vertical-align:baseline;">a. </span><a href=3D"ht=
tps://groups.google.com/a/isocpp.org/forum/#%21topic/std-proposals/3g6ZIWed=
GJ8" style=3D"text-decoration:none;"><span style=3D"font-size:15px;font-fam=
ily:Arial;color:#1155cc;background-color:transparent;font-weight:normal;fon=
t-style:normal;font-variant:normal;text-decoration:underline;vertical-align=
:baseline;">https://groups.google.com/a/isocpp.org/forum/#!topic/std-propos=
als/3g6ZIWedGJ8</span></a><span style=3D"font-size:15px;font-family:Arial;c=
olor:#000000;background-color:transparent;font-weight:normal;font-style:nor=
mal;font-variant:normal;text-decoration:none;vertical-align:baseline;"></sp=
an></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-botto=
m:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backg=
round-color:transparent;font-weight:normal;font-style:normal;font-variant:n=
ormal;text-decoration:none;vertical-align:baseline;">It
 has the advantage of not requiring to change the syntax, but in force a
 new model of stack-based calls. It does so in purpose to let nested=20
functions to yield value, which I think is not really necessary. (If we=20
let nested functions return value on behalf of their callee, we should=20
start this in regular functions). Also, Its syntax is somehow complex.</spa=
n></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom=
:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgr=
ound-color:transparent;font-weight:normal;font-style:normal;font-variant:no=
rmal;text-decoration:none;vertical-align:baseline;">b. </span><a href=3D"ht=
tps://groups.google.com/a/isocpp.org/forum/#%21topic/std-proposals/PPZJVTDd=
DVQ" style=3D"text-decoration:none;"><span style=3D"font-size:15px;font-fam=
ily:Arial;color:#1155cc;background-color:transparent;font-weight:normal;fon=
t-style:normal;font-variant:normal;text-decoration:underline;vertical-align=
:baseline;">https://groups.google.com/a/isocpp.org/forum/#!topic/std-propos=
als/PPZJVTDdDVQ</span></a><span style=3D"font-size:15px;font-family:Arial;c=
olor:#000000;background-color:transparent;font-weight:normal;font-style:nor=
mal;font-variant:normal;text-decoration:none;vertical-align:baseline;"></sp=
an></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-botto=
m:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backg=
round-color:transparent;font-weight:normal;font-style:normal;font-variant:n=
ormal;text-decoration:none;vertical-align:baseline;">It
 is easy to use and doesn=92t require a new stack, and I think that this=20
is the right direction. However, it ignores some technical details=20
(lifetime of locals, etc). Also, adding a keyword may break too many=20
working code, and my personal opinion is that it is ugly. Sentences like
 =93void numbers() yields int=94 reminds me too many things I hate in Java.=
=20
The alternative syntax (described at the end of this proposal) is not so
 ugly, but still complex.</span></p><p dir=3D"ltr" style=3D"line-height:1.1=
5;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-fam=
ily:Arial;color:#000000;background-color:transparent;font-weight:normal;fon=
t-style:normal;font-variant:normal;text-decoration:none;vertical-align:base=
line;">There is even a nice implementation of coroutines (using macros): </=
span><a href=3D"http://www.chiark.greenend.org.uk/%7Esgtatham/coroutines.ht=
ml" style=3D"text-decoration:none;"><span style=3D"font-size:15px;font-fami=
ly:Arial;color:#1155cc;background-color:transparent;font-weight:normal;font=
-style:normal;font-variant:normal;text-decoration:underline;vertical-align:=
baseline;">http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html</spa=
n></a><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgro=
und-color:transparent;font-weight:normal;font-style:normal;font-variant:nor=
mal;text-decoration:none;vertical-align:baseline;"></span></p><p dir=3D"ltr=
" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=
=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transpa=
rent;font-weight:normal;font-style:normal;font-variant:normal;text-decorati=
on:none;vertical-align:baseline;">but
 it has 2 major disadvantages: while using it, we can=92t yield a value=20
from within a switch statement, and, much more important, we have to=20
define all the local variables at the top of the function - back to C90=20
days! (and with constructors this is much worst.)</span></p><br><span style=
=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transpa=
rent;font-weight:normal;font-style:normal;font-variant:normal;text-decorati=
on:none;vertical-align:baseline;"></span><p dir=3D"ltr" style=3D"line-heigh=
t:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;fon=
t-family:Arial;color:#000000;background-color:transparent;font-weight:norma=
l;font-style:normal;font-variant:normal;text-decoration:none;vertical-align=
:baseline;">Another
 thing that was very little talk about, is for-range loops native=20
support. Let=92s say we have a Fibonacci number generator (a very common=20
example):</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:=
#000000;background-color:transparent;font-weight:normal;font-style:normal;f=
ont-variant:normal;text-decoration:none;vertical-align:baseline;">(Using De=
nis Bredelet=92s proposal syntax)</span></p><p dir=3D"ltr" style=3D"line-he=
ight:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;=
font-family:Arial;color:#000000;background-color:transparent;font-weight:no=
rmal;font-style:normal;font-variant:normal;text-decoration:none;vertical-al=
ign:baseline;">void fib(int n) yields int {</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font=
-size:15px;font-family:Arial;color:#000000;background-color:transparent;fon=
t-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;=
vertical-align:baseline;"> &nbsp;int a=3D0,b=3D1;</span></p><p dir=3D"ltr" =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D=
"font-size:15px;font-family:Arial;color:#000000;background-color:transparen=
t;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:=
none;vertical-align:baseline;"> &nbsp;while(n--) {</span></p><p dir=3D"ltr"=
 style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=
=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transpa=
rent;font-weight:normal;font-style:normal;font-variant:normal;text-decorati=
on:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;int c=3Da+b;</span></p=
><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;=
"><span style=3D"font-size:15px;font-family:Arial;color:#000000;background-=
color:transparent;font-weight:normal;font-style:normal;font-variant:normal;=
text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;a=3Db;</s=
pan></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bott=
om:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;back=
ground-color:transparent;font-weight:normal;font-style:normal;font-variant:=
normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;b=
=3Dc;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000=
000;background-color:transparent;font-weight:normal;font-style:normal;font-=
variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;=
&nbsp;yield c;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-to=
p:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;c=
olor:#000000;background-color:transparent;font-weight:normal;font-style:nor=
mal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &nb=
sp;}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;marg=
in-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#0000=
00;background-color:transparent;font-weight:normal;font-style:normal;font-v=
ariant:normal;text-decoration:none;vertical-align:baseline;">}</span></p><p=
 dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><=
span style=3D"font-size:15px;font-family:Arial;color:#000000;background-col=
or:transparent;font-weight:normal;font-style:normal;font-variant:normal;tex=
t-decoration:none;vertical-align:baseline;">We want the possibility to writ=
e </span><span style=3D"font-size:15px;font-family:Arial;color:#000000;back=
ground-color:transparent;font-weight:normal;font-style:italic;font-variant:=
normal;text-decoration:none;vertical-align:baseline;">for (int i : fib(10))=
 std::cout&lt;&lt;i&lt;&lt;=92\n=92;</span><span style=3D"font-size:15px;fo=
nt-family:Arial;color:#000000;background-color:transparent;font-weight:norm=
al;font-style:normal;font-variant:normal;text-decoration:none;vertical-alig=
n:baseline;"> to print the first 10 Fibonacci numbers.</span></p><br><span =
style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:tr=
ansparent;font-weight:normal;font-style:normal;font-variant:normal;text-dec=
oration:none;vertical-align:baseline;"></span><p dir=3D"ltr" style=3D"line-=
height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15p=
x;font-family:Arial;color:#000000;background-color:transparent;font-weight:=
normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-=
align:baseline;">So what am I suggest?</span></p><p dir=3D"ltr" style=3D"li=
ne-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:=
15px;font-family:Arial;color:#000000;background-color:transparent;font-weig=
ht:normal;font-style:normal;font-variant:normal;text-decoration:none;vertic=
al-align:baseline;">First,
 to the syntax. Since we want it to work natively with for-range loops,=20
and since the &nbsp;language concept is =93declare it the way you will use =
it=94,
 I would suggest using colon in the function signature. The nicest idea I
 managed to think so far is </span><span style=3D"font-size:15px;font-famil=
y:Arial;color:#000000;background-color:transparent;font-weight:normal;font-=
style:italic;font-variant:normal;text-decoration:none;vertical-align:baseli=
ne;">int : fib(int n)</span></p><p dir=3D"ltr" style=3D"line-height:1.15;ma=
rgin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:=
Arial;color:#000000;background-color:transparent;font-weight:normal;font-st=
yle:normal;font-variant:normal;text-decoration:none;vertical-align:baseline=
;">Also, there is no reason to add the keyword </span><span style=3D"font-s=
ize:15px;font-family:Arial;color:#000000;background-color:transparent;font-=
weight:normal;font-style:italic;font-variant:normal;text-decoration:none;ve=
rtical-align:baseline;">yield</span><span style=3D"font-size:15px;font-fami=
ly:Arial;color:#000000;background-color:transparent;font-weight:normal;font=
-style:normal;font-variant:normal;text-decoration:none;vertical-align:basel=
ine;">, when we can stick to good old </span><span style=3D"font-size:15px;=
font-family:Arial;color:#000000;background-color:transparent;font-weight:no=
rmal;font-style:italic;font-variant:normal;text-decoration:none;vertical-al=
ign:baseline;">return</span><span style=3D"font-size:15px;font-family:Arial=
;color:#000000;background-color:transparent;font-weight:normal;font-style:n=
ormal;font-variant:normal;text-decoration:none;vertical-align:baseline;">.<=
/span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bo=
ttom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;ba=
ckground-color:transparent;font-weight:normal;font-style:normal;font-varian=
t:normal;text-decoration:none;vertical-align:baseline;">Now, to the real st=
uff: What does </span><span style=3D"font-size:15px;font-family:Arial;color=
:#000000;background-color:transparent;font-weight:normal;font-style:italic;=
font-variant:normal;text-decoration:none;vertical-align:baseline;">fib(10)<=
/span><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgro=
und-color:transparent;font-weight:normal;font-style:normal;font-variant:nor=
mal;text-decoration:none;vertical-align:baseline;"> mean? What=92s the type=
 of </span><span style=3D"font-size:15px;font-family:Arial;color:#000000;ba=
ckground-color:transparent;font-weight:normal;font-style:italic;font-varian=
t:normal;text-decoration:none;vertical-align:baseline;">fib(10).begin()</sp=
an><span style=3D"font-size:15px;font-family:Arial;color:#000000;background=
-color:transparent;font-weight:normal;font-style:normal;font-variant:normal=
;text-decoration:none;vertical-align:baseline;">?</span></p><p dir=3D"ltr" =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D=
"font-size:15px;font-family:Arial;color:#000000;background-color:transparen=
t;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:=
none;vertical-align:baseline;">I
 suggest this meaning: fib will be (auto-generated) class, and an object
 of it will represent calling the =93function=94 with specific parameters.=
=20
The member function </span><span style=3D"font-size:15px;font-family:Arial;=
color:#000000;background-color:transparent;font-weight:normal;font-style:it=
alic;font-variant:normal;text-decoration:none;vertical-align:baseline;">beg=
in</span><span style=3D"font-size:15px;font-family:Arial;color:#000000;back=
ground-color:transparent;font-weight:normal;font-style:normal;font-variant:=
normal;text-decoration:none;vertical-align:baseline;"> (and </span><span st=
yle=3D"font-size:15px;font-family:Arial;color:#000000;background-color:tran=
sparent;font-weight:normal;font-style:italic;font-variant:normal;text-decor=
ation:none;vertical-align:baseline;">end</span><span style=3D"font-size:15p=
x;font-family:Arial;color:#000000;background-color:transparent;font-weight:=
normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-=
align:baseline;">) will return some sort of iterator, which will represent =
the actual call.</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-=
top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial=
;color:#000000;background-color:transparent;font-weight:normal;font-style:n=
ormal;font-variant:normal;text-decoration:none;vertical-align:baseline;">So=
me details: the </span><span style=3D"font-size:15px;font-family:Arial;colo=
r:#000000;background-color:transparent;font-weight:normal;font-style:italic=
;font-variant:normal;text-decoration:none;vertical-align:baseline;">fib</sp=
an><span style=3D"font-size:15px;font-family:Arial;color:#000000;background=
-color:transparent;font-weight:normal;font-style:normal;font-variant:normal=
;text-decoration:none;vertical-align:baseline;"> class should have some mem=
bers, to contain the parameters it called with, but the real fun is in the =
</span><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgr=
ound-color:transparent;font-weight:normal;font-style:italic;font-variant:no=
rmal;text-decoration:none;vertical-align:baseline;">iterator</span><span st=
yle=3D"font-size:15px;font-family:Arial;color:#000000;background-color:tran=
sparent;font-weight:normal;font-style:normal;font-variant:normal;text-decor=
ation:none;vertical-align:baseline;">
 class: it will have (in addition to the parameters), &nbsp;as (not exactly=
, I
 will explain below) members, all the local variables of the =93function=94=
=20
(including the return value), and also the information about where it=20
stopped last time (and should resume from) - let=92s call it, from now on,
 =93position data=94.</span></p><p dir=3D"ltr" style=3D"line-height:1.15;ma=
rgin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:=
Arial;color:#000000;background-color:transparent;font-weight:normal;font-st=
yle:normal;font-variant:normal;text-decoration:none;vertical-align:baseline=
;">To be more precise: an </span><span style=3D"font-size:15px;font-family:=
Arial;color:#000000;background-color:transparent;font-weight:normal;font-st=
yle:italic;font-variant:normal;text-decoration:none;vertical-align:baseline=
;">iterator</span><span style=3D"font-size:15px;font-family:Arial;color:#00=
0000;background-color:transparent;font-weight:normal;font-style:normal;font=
-variant:normal;text-decoration:none;vertical-align:baseline;">
 should contain the memory for the local variables (like every member=20
variable), but their lifetime will be as if they were local variables of
 the =93function=94. I mean - they will been constructed only when the=20
=93function=94 will decide so, and not automatically when the </span><span =
style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:tr=
ansparent;font-weight:normal;font-style:italic;font-variant:normal;text-dec=
oration:none;vertical-align:baseline;">iterator</span><span style=3D"font-s=
ize:15px;font-family:Arial;color:#000000;background-color:transparent;font-=
weight:normal;font-style:normal;font-variant:normal;text-decoration:none;ve=
rtical-align:baseline;"> is been constructed.</span></p><p dir=3D"ltr" styl=
e=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"fon=
t-size:15px;font-family:Arial;color:#000000;background-color:transparent;fo=
nt-weight:normal;font-style:normal;font-variant:normal;text-decoration:none=
;vertical-align:baseline;">When the =93function=94 ends (either by falling =
through the ending brace, not catching exception, or simply saying </span><=
span style=3D"font-size:15px;font-family:Arial;color:#000000;background-col=
or:transparent;font-weight:normal;font-style:italic;font-variant:normal;tex=
t-decoration:none;vertical-align:baseline;">return;</span><span style=3D"fo=
nt-size:15px;font-family:Arial;color:#000000;background-color:transparent;f=
ont-weight:normal;font-style:normal;font-variant:normal;text-decoration:non=
e;vertical-align:baseline;">
 without a value), the position data should contain this information,=20
and (like every function), every local variable should be destructed.</span=
></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:=
0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgro=
und-color:transparent;font-weight:normal;font-style:normal;font-variant:nor=
mal;text-decoration:none;vertical-align:baseline;">Knowing
 the position data let us easily determine which variables are alive,=20
and so I think that the following member functions can be automatically=20
created:</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;=
margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#=
000000;background-color:transparent;font-weight:normal;font-style:normal;fo=
nt-variant:normal;text-decoration:none;vertical-align:baseline;">copy const=
ructor - should copy the position data, the parameters, and every living lo=
cal variable</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;col=
or:#000000;background-color:transparent;font-weight:normal;font-style:norma=
l;font-variant:normal;text-decoration:none;vertical-align:baseline;">move c=
onstructor - the same, but move instead of copy</span></p><p dir=3D"ltr" st=
yle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"f=
ont-size:15px;font-family:Arial;color:#000000;background-color:transparent;=
font-weight:normal;font-style:normal;font-variant:normal;text-decoration:no=
ne;vertical-align:baseline;">destructor - destroy the parameters, and every=
 living local variable.</span></p><p dir=3D"ltr" style=3D"line-height:1.15;=
margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-famil=
y:Arial;color:#000000;background-color:transparent;font-weight:normal;font-=
style:normal;font-variant:normal;text-decoration:none;vertical-align:baseli=
ne;">(Of course, if some local variable is noncopyable, so is the iterator)=
</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-b=
ottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;b=
ackground-color:transparent;font-weight:normal;font-style:normal;font-varia=
nt:normal;text-decoration:none;vertical-align:baseline;">I think that it sh=
ould not be assignable - If one iterator have a live object, and another on=
e have not, it=92s a real mess.</span></p><br><span style=3D"font-size:15px=
;font-family:Arial;color:#000000;background-color:transparent;font-weight:n=
ormal;font-style:normal;font-variant:normal;text-decoration:none;vertical-a=
lign:baseline;"></span><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;col=
or:#000000;background-color:transparent;font-weight:normal;font-style:norma=
l;font-variant:normal;text-decoration:none;vertical-align:baseline;">Some e=
xample:</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;m=
argin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#0=
00000;background-color:transparent;font-weight:normal;font-style:normal;fon=
t-variant:normal;text-decoration:none;vertical-align:baseline;">Suppose
 that we want to yield the number 0, and then, the first n Fibonacci=20
numbers and the first n even number, alternately. To add more interest=20
(and to demonstrate more rules), I want to create and destroy some=20
objects (assume </span><span style=3D"font-size:15px;font-family:Arial;colo=
r:#000000;background-color:transparent;font-weight:normal;font-style:italic=
;font-variant:normal;text-decoration:none;vertical-align:baseline;">A</span=
><span style=3D"font-size:15px;font-family:Arial;color:#000000;background-c=
olor:transparent;font-weight:normal;font-style:normal;font-variant:normal;t=
ext-decoration:none;vertical-align:baseline;"> is a copyable, moveable, and=
 int-constructive class), so I=92ve written the following code:</span></p><=
p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;">=
<span style=3D"font-size:15px;font-family:Arial;color:#000000;background-co=
lor:transparent;font-weight:normal;font-style:normal;font-variant:normal;te=
xt-decoration:none;vertical-align:baseline;">int : fib_even(int n) {</span>=
</p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0=
pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgrou=
nd-color:transparent;font-weight:normal;font-style:normal;font-variant:norm=
al;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;A a(7)=
;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-=
bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;=
background-color:transparent;font-weight:normal;font-style:normal;font-vari=
ant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbs=
p;int fib1=3D0,fib2=3D1,even=3D0;</span></p><p dir=3D"ltr" style=3D"line-he=
ight:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;=
font-family:Arial;color:#000000;background-color:transparent;font-weight:no=
rmal;font-style:normal;font-variant:normal;text-decoration:none;vertical-al=
ign:baseline;"> &nbsp;&nbsp;&nbsp;return 0;</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font=
-size:15px;font-family:Arial;color:#000000;background-color:transparent;fon=
t-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;=
vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;while(n--) {</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span=
 style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:t=
ransparent;font-weight:normal;font-style:normal;font-variant:normal;text-de=
coration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nb=
sp;int fib3=3Dfib1+fib2;</span></p><p dir=3D"ltr" style=3D"line-height:1.15=
;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-fami=
ly:Arial;color:#000000;background-color:transparent;font-weight:normal;font=
-style:normal;font-variant:normal;text-decoration:none;vertical-align:basel=
ine;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;fib1=3Dfib2;</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span=
 style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:t=
ransparent;font-weight:normal;font-style:normal;font-variant:normal;text-de=
coration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nb=
sp;fib2=3Dfib3;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-t=
op:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;=
color:#000000;background-color:transparent;font-weight:normal;font-style:no=
rmal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;return fib3;</span></p><p dir=3D"ltr" st=
yle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"f=
ont-size:15px;font-family:Arial;color:#000000;background-color:transparent;=
font-weight:normal;font-style:normal;font-variant:normal;text-decoration:no=
ne;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;A b=3Dn;=
</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-b=
ottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;b=
ackground-color:transparent;font-weight:normal;font-style:normal;font-varia=
nt:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; &nbsp;return even+=3D2;</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:1=
5px;font-family:Arial;color:#000000;background-color:transparent;font-weigh=
t:normal;font-style:normal;font-variant:normal;text-decoration:none;vertica=
l-align:baseline;"> &nbsp;&nbsp;&nbsp;}</span></p><p dir=3D"ltr" style=3D"l=
ine-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size=
:15px;font-family:Arial;color:#000000;background-color:transparent;font-wei=
ght:normal;font-style:normal;font-variant:normal;text-decoration:none;verti=
cal-align:baseline;">}</span></p><br><span style=3D"font-size:15px;font-fam=
ily:Arial;color:#000000;background-color:transparent;font-weight:normal;fon=
t-style:normal;font-variant:normal;text-decoration:none;vertical-align:base=
line;"></span><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margi=
n-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#00000=
0;background-color:transparent;font-weight:normal;font-style:normal;font-va=
riant:normal;text-decoration:none;vertical-align:baseline;">A compiler may =
expand it to something like:</span></p><p dir=3D"ltr" style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-=
family:Arial;color:#000000;background-color:transparent;font-weight:normal;=
font-style:normal;font-variant:normal;text-decoration:none;vertical-align:b=
aseline;">(Note:
 I=92m using dynamic memory allocation, but It=92s not really how it should=
=20
be implemented - I just don=92t want some constructors and destructors to=
=20
been invoked automatically)</span></p><br><span style=3D"font-size:15px;fon=
t-family:Arial;color:#000000;background-color:transparent;font-weight:norma=
l;font-style:normal;font-variant:normal;text-decoration:none;vertical-align=
:baseline;"></span><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;=
margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#=
000000;background-color:transparent;font-weight:normal;font-style:normal;fo=
nt-variant:normal;text-decoration:none;vertical-align:baseline;">class fib_=
even {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#00=
0000;background-color:transparent;font-weight:normal;font-style:normal;font=
-variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp=
;&nbsp;class iterator {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;=
margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-famil=
y:Arial;color:#000000;background-color:transparent;font-weight:normal;font-=
style:normal;font-variant:normal;text-decoration:none;vertical-align:baseli=
ne;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;int n;</span></p><p dir=3D"ltr" =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D=
"font-size:15px;font-family:Arial;color:#000000;background-color:transparen=
t;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:=
none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;int *f=
ib1,*fib2,*fib3,*even;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;m=
argin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family=
:Arial;color:#000000;background-color:transparent;font-weight:normal;font-s=
tyle:normal;font-variant:normal;text-decoration:none;vertical-align:baselin=
e;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;A *a,*b;</span></p><p dir=3D"ltr"=
 style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=
=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transpa=
rent;font-weight:normal;font-style:normal;font-variant:normal;text-decorati=
on:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;int=
 *ret_value;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;col=
or:#000000;background-color:transparent;font-weight:normal;font-style:norma=
l;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;enum {p0,p1,p2,p3,p4} pos; //resuming point=
s<br></span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000=
000;background-color:transparent;font-weight:normal;font-style:normal;font-=
variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; &nbsp;void next() {</span></p><p dir=3D"ltr" style=3D"li=
ne-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:=
15px;font-family:Arial;color:#000000;background-color:transparent;font-weig=
ht:normal;font-style:normal;font-variant:normal;text-decoration:none;vertic=
al-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbs=
p;switch (pos) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-=
top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial=
;color:#000000;background-color:transparent;font-weight:normal;font-style:n=
ormal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;c=
ase p0: break;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-to=
p:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;c=
olor:#000000;background-color:transparent;font-weight:normal;font-style:nor=
mal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;cas=
e p1: goto label1;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margi=
n-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Ari=
al;color:#000000;background-color:transparent;font-weight:normal;font-style=
:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;">=
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp=
;case p2: goto label2;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;m=
argin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family=
:Arial;color:#000000;background-color:transparent;font-weight:normal;font-s=
tyle:normal;font-variant:normal;text-decoration:none;vertical-align:baselin=
e;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &=
nbsp;case p3: goto label3;</span></p><p dir=3D"ltr" style=3D"line-height:1.=
15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-fa=
mily:Arial;color:#000000;background-color:transparent;font-weight:normal;fo=
nt-style:normal;font-variant:normal;text-decoration:none;vertical-align:bas=
eline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbs=
p; &nbsp;case p4: return;</span></p><p dir=3D"ltr" style=3D"line-height:1.1=
5;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-fam=
ily:Arial;color:#000000;background-color:transparent;font-weight:normal;fon=
t-style:normal;font-variant:normal;text-decoration:none;vertical-align:base=
line;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}</span></p=
><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;=
"><span style=3D"font-size:15px;font-family:Arial;color:#000000;background-=
color:transparent;font-weight:normal;font-style:normal;font-variant:normal;=
text-decoration:none;vertical-align:baseline;">//construct automatic variab=
les of t</span><span style=3D"font-size:15px;font-family:Arial;color:#00000=
0;background-color:transparent;font-weight:normal;font-style:normal;font-va=
riant:normal;text-decoration:none;vertical-align:baseline;">he function<br>=
</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-b=
ottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;b=
ackground-color:transparent;font-weight:normal;font-style:normal;font-varia=
nt:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;a=3Dnew A(7);</span></p><p dir=3D"lt=
r" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=
=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transpa=
rent;font-weight:normal;font-style:normal;font-variant:normal;text-decorati=
on:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nb=
sp;&nbsp; &nbsp;fib1=3Dnew int(0);</span></p><p dir=3D"ltr" style=3D"line-h=
eight:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px=
;font-family:Arial;color:#000000;background-color:transparent;font-weight:n=
ormal;font-style:normal;font-variant:normal;text-decoration:none;vertical-a=
lign:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fi=
b2=3Dnew int(1);</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-=
top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial=
;color:#000000;background-color:transparent;font-weight:normal;font-style:n=
ormal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;even=3Dnew int(0);</=
span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bot=
tom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;bac=
kground-color:transparent;font-weight:normal;font-style:normal;font-variant=
:normal;text-decoration:none;vertical-align:baseline;">//t</span><span styl=
e=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transp=
arent;font-weight:normal;font-style:normal;font-variant:normal;text-decorat=
ion:none;vertical-align:baseline;">he return process - create t</span><span=
 style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:t=
ransparent;font-weight:normal;font-style:normal;font-variant:normal;text-de=
coration:none;vertical-align:baseline;">he value, save t</span><span style=
=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transpa=
rent;font-weight:normal;font-style:normal;font-variant:normal;text-decorati=
on:none;vertical-align:baseline;">he resuming point, and return<br></span><=
/p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0p=
t;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgroun=
d-color:transparent;font-weight:normal;font-style:normal;font-variant:norma=
l;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ret_value=3Dnew int(0);</span></p><p dir=3D"=
ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span sty=
le=3D"font-size:15px;font-family:Arial;color:#000000;background-color:trans=
parent;font-weight:normal;font-style:normal;font-variant:normal;text-decora=
tion:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&=
nbsp;&nbsp; &nbsp;pos=3Dp1;</span></p><p dir=3D"ltr" style=3D"line-height:1=
..15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-f=
amily:Arial;color:#000000;background-color:transparent;font-weight:normal;f=
ont-style:normal;font-variant:normal;text-decoration:none;vertical-align:ba=
seline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return;</=
span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bot=
tom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;bac=
kground-color:transparent;font-weight:normal;font-style:normal;font-variant=
:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; &nbsp;label1:<br></span></p><p dir=3D"ltr" style=3D"line-height=
:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font=
-family:Arial;color:#000000;background-color:transparent;font-weight:normal=
;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:=
baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;while(n=
--) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000=
000;background-color:transparent;font-weight:normal;font-style:normal;font-=
variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fib3=3Dnew i=
nt(*fib1+*fib2); //being constructed only now<br></span></p><p dir=3D"ltr" =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D=
"font-size:15px;font-family:Arial;color:#000000;background-color:transparen=
t;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:=
none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;=
&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;*fib1=3D*fib2;</span></p><p dir=3D"ltr" sty=
le=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"fo=
nt-size:15px;font-family:Arial;color:#000000;background-color:transparent;f=
ont-weight:normal;font-style:normal;font-variant:normal;text-decoration:non=
e;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nb=
sp; &nbsp;&nbsp;&nbsp; &nbsp;*fib2=3D*fib3;</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font=
-size:15px;font-family:Arial;color:#000000;background-color:transparent;fon=
t-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;=
vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp=
; &nbsp;&nbsp;&nbsp; &nbsp;ret_value=3Dnew int(*fib3);</span></p><p dir=3D"=
ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span sty=
le=3D"font-size:15px;font-family:Arial;color:#000000;background-color:trans=
parent;font-weight:normal;font-style:normal;font-variant:normal;text-decora=
tion:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&=
nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pos=3Dp2;</span></p><p dir=3D"ltr" sty=
le=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"fo=
nt-size:15px;font-family:Arial;color:#000000;background-color:transparent;f=
ont-weight:normal;font-style:normal;font-variant:normal;text-decoration:non=
e;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nb=
sp; &nbsp;&nbsp;&nbsp; &nbsp;return;</span></p><p dir=3D"ltr" style=3D"line=
-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15=
px;font-family:Arial;color:#000000;background-color:transparent;font-weight=
:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical=
-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;label2:</span></p><=
p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;">=
<span style=3D"font-size:15px;font-family:Arial;color:#000000;background-co=
lor:transparent;font-weight:normal;font-style:normal;font-variant:normal;te=
xt-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;b=3Dnew A(n);</span></p><p di=
r=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><spa=
n style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:=
transparent;font-weight:normal;font-style:normal;font-variant:normal;text-d=
ecoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &n=
bsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ret_value=3Dnew int((*even)+=3D2)=
;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-=
bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;=
background-color:transparent;font-weight:normal;font-style:normal;font-vari=
ant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pos=3Dp3;</span>=
</p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0=
pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgrou=
nd-color:transparent;font-weight:normal;font-style:normal;font-variant:norm=
al;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return;</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span=
 style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:t=
ransparent;font-weight:normal;font-style:normal;font-variant:normal;text-de=
coration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nb=
sp;label3:</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0p=
t;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color=
:#000000;background-color:transparent;font-weight:normal;font-style:normal;=
font-variant:normal;text-decoration:none;vertical-align:baseline;">//automa=
tic variables going out of scope, and s</span><span style=3D"font-size:15px=
;font-family:Arial;color:#000000;background-color:transparent;font-weight:n=
ormal;font-style:normal;font-variant:normal;text-decoration:none;vertical-a=
lign:baseline;"><span style=3D"font-size:15px;font-family:Arial;color:#0000=
00;background-color:transparent;font-weight:normal;font-style:normal;font-v=
ariant:normal;text-decoration:none;vertical-align:baseline;">h</span>ould b=
e destructed<br></span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-=
top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial=
;color:#000000;background-color:transparent;font-weight:normal;font-style:n=
ormal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;d=
elete b;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;=
margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#=
000000;background-color:transparent;font-weight:normal;font-style:normal;fo=
nt-variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete fi=
b3;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margi=
n-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#00000=
0;background-color:transparent;font-weight:normal;font-style:normal;font-va=
riant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font=
-size:15px;font-family:Arial;color:#000000;background-color:transparent;fon=
t-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;=
vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp=
; &nbsp;delete even;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;mar=
gin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:A=
rial;color:#000000;background-color:transparent;font-weight:normal;font-sty=
le:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;=
"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete fib2;</sp=
an></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-botto=
m:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backg=
round-color:transparent;font-weight:normal;font-style:normal;font-variant:n=
ormal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete fib1;</span></p><p dir=3D"ltr" st=
yle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"f=
ont-size:15px;font-family:Arial;color:#000000;background-color:transparent;=
font-weight:normal;font-style:normal;font-variant:normal;text-decoration:no=
ne;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&n=
bsp; &nbsp;delete a;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;mar=
gin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:A=
rial;color:#000000;background-color:transparent;font-weight:normal;font-sty=
le:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;=
"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pos=3Dp4;</span>=
</p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0=
pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgrou=
nd-color:transparent;font-weight:normal;font-style:normal;font-variant:norm=
al;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp; &nbsp;}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-to=
p:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;c=
olor:#000000;background-color:transparent;font-weight:normal;font-style:nor=
mal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;iterator(int n) : n(n),pos(p0) {</span></=
p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt=
;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;background=
-color:transparent;font-weight:normal;font-style:normal;font-variant:normal=
;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; &nbsp;&nbsp;&nbsp; &nbsp;next(); //get t</span><span style=3D"font-siz=
e:15px;font-family:Arial;color:#000000;background-color:transparent;font-we=
ight:normal;font-style:normal;font-variant:normal;text-decoration:none;vert=
ical-align:baseline;">he first value<br></span></p><p dir=3D"ltr" style=3D"=
line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-siz=
e:15px;font-family:Arial;color:#000000;background-color:transparent;font-we=
ight:normal;font-style:normal;font-variant:normal;text-decoration:none;vert=
ical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;}</span></p><p =
dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><s=
pan style=3D"font-size:15px;font-family:Arial;color:#000000;background-colo=
r:transparent;font-weight:normal;font-style:normal;font-variant:normal;text=
-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;iterator() : pos(p4) {}</span></p><p dir=3D"ltr" style=3D"line-height=
:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font=
-family:Arial;color:#000000;background-color:transparent;font-weight:normal=
;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:=
baseline;"> &nbsp;&nbsp;&nbsp;public:</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:1=
5px;font-family:Arial;color:#000000;background-color:transparent;font-weigh=
t:normal;font-style:normal;font-variant:normal;text-decoration:none;vertica=
l-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;iterator &amp;oper=
ator++() {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0p=
t;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color=
:#000000;background-color:transparent;font-weight:normal;font-style:normal;=
font-variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete ret_value;</span></=
p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt=
;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;background=
-color:transparent;font-weight:normal;font-style:normal;font-variant:normal=
;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; &nbsp;&nbsp;&nbsp; &nbsp;next();</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:1=
5px;font-family:Arial;color:#000000;background-color:transparent;font-weigh=
t:normal;font-style:normal;font-variant:normal;text-decoration:none;vertica=
l-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp=
;return *this;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-to=
p:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;c=
olor:#000000;background-color:transparent;font-weight:normal;font-style:nor=
mal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;}</span></p><p dir=3D"ltr" style=3D"line-=
height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15p=
x;font-family:Arial;color:#000000;background-color:transparent;font-weight:=
normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-=
align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;int &amp;operator*()=
 {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin=
-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000=
;background-color:transparent;font-weight:normal;font-style:normal;font-var=
iant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return *ret_value;</span></p><p di=
r=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><spa=
n style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:=
transparent;font-weight:normal;font-style:normal;font-variant:normal;text-d=
ecoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &n=
bsp;}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000=
000;background-color:transparent;font-weight:normal;font-style:normal;font-=
variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; &nbsp;iterator(const iterator &amp;it) : n(it.n),pos(it.=
pos) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#00=
0000;background-color:transparent;font-weight:normal;font-style:normal;font=
-variant:normal;text-decoration:none;vertical-align:baseline;">//copy only =
living members<br></span></p><p dir=3D"ltr" style=3D"line-height:1.15;margi=
n-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Ari=
al;color:#000000;background-color:transparent;font-weight:normal;font-style=
:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;">=
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (pos&gt;p0 &amp=
;&amp; pos&lt;p4) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;marg=
in-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Ar=
ial;color:#000000;background-color:transparent;font-weight:normal;font-styl=
e:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;"=
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbs=
p;ret_value=3Dnew int(*it.ret_value);</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:1=
5px;font-family:Arial;color:#000000;background-color:transparent;font-weigh=
t:normal;font-style:normal;font-variant:normal;text-decoration:none;vertica=
l-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp=
;&nbsp;&nbsp; &nbsp;a=3Dnew A(*it.a);</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:1=
5px;font-family:Arial;color:#000000;background-color:transparent;font-weigh=
t:normal;font-style:normal;font-variant:normal;text-decoration:none;vertica=
l-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp=
;&nbsp;&nbsp; &nbsp;fib1=3Dnew int(*it.fib1);</span></p><p dir=3D"ltr" styl=
e=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"fon=
t-size:15px;font-family:Arial;color:#000000;background-color:transparent;fo=
nt-weight:normal;font-style:normal;font-variant:normal;text-decoration:none=
;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbs=
p; &nbsp;&nbsp;&nbsp; &nbsp;fib2=3Dnew int(*it.fib2);</span></p><p dir=3D"l=
tr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span styl=
e=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transp=
arent;font-weight:normal;font-style:normal;font-variant:normal;text-decorat=
ion:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&n=
bsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;even=3Dnew int(*it.even);</span></p><p =
dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><s=
pan style=3D"font-size:15px;font-family:Arial;color:#000000;background-colo=
r:transparent;font-weight:normal;font-style:normal;font-variant:normal;text=
-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; &nbsp;}</span></p><p dir=3D"ltr" style=3D"line-height:1.=
15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-fa=
mily:Arial;color:#000000;background-color:transparent;font-weight:normal;fo=
nt-style:normal;font-variant:normal;text-decoration:none;vertical-align:bas=
eline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (pos&gt=
;p1 &amp;&amp; pos&lt;p4) fib3=3Dnew int(*it.fib3);</span></p><p dir=3D"ltr=
" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=
=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transpa=
rent;font-weight:normal;font-style:normal;font-variant:normal;text-decorati=
on:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nb=
sp;&nbsp; &nbsp;if (pos&gt;p2 &amp;&amp; pos&lt;p4) b=3Dnew A(*it.b);</span=
></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:=
0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgro=
und-color:transparent;font-weight:normal;font-style:normal;font-variant:nor=
mal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; &nbsp;}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-t=
op:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;=
color:#000000;background-color:transparent;font-weight:normal;font-style:no=
rmal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;iterator(iterator &amp;&amp;it) : n(std:=
:move(it.n)),pos(it.pos) {</span></p><p dir=3D"ltr" style=3D"line-height:1.=
15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-fa=
mily:Arial;color:#000000;background-color:transparent;font-weight:normal;fo=
nt-style:normal;font-variant:normal;text-decoration:none;vertical-align:bas=
eline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (pos&gt=
;p0 &amp;&amp; pos&lt;p4) {</span></p><p dir=3D"ltr" style=3D"line-height:1=
..15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-f=
amily:Arial;color:#000000;background-color:transparent;font-weight:normal;f=
ont-style:normal;font-variant:normal;text-decoration:none;vertical-align:ba=
seline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nb=
sp; &nbsp;ret_value=3Dnew int(std::move(*it.ret_value));</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span=
 style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:t=
ransparent;font-weight:normal;font-style:normal;font-variant:normal;text-de=
coration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nb=
sp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;a=3Dnew A(std::move(*it.a));</span=
></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:=
0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgro=
und-color:transparent;font-weight:normal;font-style:normal;font-variant:nor=
mal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fib1=3Dnew int(std::mov=
e(*it.fib1));</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top=
:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;co=
lor:#000000;background-color:transparent;font-weight:normal;font-style:norm=
al;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fib2=
=3Dnew int(std::move(*it.fib2));</span></p><p dir=3D"ltr" style=3D"line-hei=
ght:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;f=
ont-family:Arial;color:#000000;background-color:transparent;font-weight:nor=
mal;font-style:normal;font-variant:normal;text-decoration:none;vertical-ali=
gn:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbs=
p;&nbsp; &nbsp;even=3Dnew int(std::move(*it.even));</span></p><p dir=3D"ltr=
" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=
=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transpa=
rent;font-weight:normal;font-style:normal;font-variant:normal;text-decorati=
on:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nb=
sp;&nbsp; &nbsp;}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin=
-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Aria=
l;color:#000000;background-color:transparent;font-weight:normal;font-style:=
normal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (pos&gt;p1 &amp;=
&amp; pos&lt;p4) fib3=3Dnew int(std::move(*it.fib3));</span></p><p dir=3D"l=
tr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span styl=
e=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transp=
arent;font-weight:normal;font-style:normal;font-variant:normal;text-decorat=
ion:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&n=
bsp;&nbsp; &nbsp;if (pos&gt;p2 &amp;&amp; pos&lt;p4) b=3Dnew A(std::move(*i=
t.b));</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#00=
0000;background-color:transparent;font-weight:normal;font-style:normal;font=
-variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; &nbsp;}</span></p><p dir=3D"ltr" style=3D"line-height:1=
..15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-f=
amily:Arial;color:#000000;background-color:transparent;font-weight:normal;f=
ont-style:normal;font-variant:normal;text-decoration:none;vertical-align:ba=
seline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;~iterator() {</span></p><p d=
ir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><sp=
an style=3D"font-size:15px;font-family:Arial;color:#000000;background-color=
:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-=
decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &=
nbsp;&nbsp;&nbsp; &nbsp;if (pos&gt;p2 &amp;&amp; pos&lt;p4) delete b;</span=
></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:=
0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgro=
und-color:transparent;font-weight:normal;font-style:normal;font-variant:nor=
mal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (pos&gt;p1 &amp;&amp; pos&lt;p4) delete=
 fib3;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#00=
0000;background-color:transparent;font-weight:normal;font-style:normal;font=
-variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (pos&gt;p0 &amp;&amp; pos&l=
t;p4) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;m=
argin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#0=
00000;background-color:transparent;font-weight:normal;font-style:normal;fon=
t-variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete eve=
n;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin=
-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000=
;background-color:transparent;font-weight:normal;font-style:normal;font-var=
iant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete fib2;</s=
pan></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bott=
om:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;back=
ground-color:transparent;font-weight:normal;font-style:normal;font-variant:=
normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete fib1;</span><=
/p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0p=
t;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgroun=
d-color:transparent;font-weight:normal;font-style:normal;font-variant:norma=
l;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete a;</span></p><p di=
r=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><spa=
n style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:=
transparent;font-weight:normal;font-style:normal;font-variant:normal;text-d=
ecoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &n=
bsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete ret_value;</span></p><p di=
r=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><spa=
n style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:=
transparent;font-weight:normal;font-style:normal;font-variant:normal;text-d=
ecoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &n=
bsp;&nbsp;&nbsp; &nbsp;}</span></p><p dir=3D"ltr" style=3D"line-height:1.15=
;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-fami=
ly:Arial;color:#000000;background-color:transparent;font-weight:normal;font=
-style:normal;font-variant:normal;text-decoration:none;vertical-align:basel=
ine;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;}</span></p><p dir=3D"ltr" styl=
e=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"fon=
t-size:15px;font-family:Arial;color:#000000;background-color:transparent;fo=
nt-weight:normal;font-style:normal;font-variant:normal;text-decoration:none=
;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;bool opera=
tor!=3D(const iterator &amp;it) {</span></p><p dir=3D"ltr" style=3D"line-he=
ight:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;=
font-family:Arial;color:#000000;background-color:transparent;font-weight:no=
rmal;font-style:normal;font-variant:normal;text-decoration:none;vertical-al=
ign:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ret=
urn pos!=3Dit.pos;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margi=
n-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Ari=
al;color:#000000;background-color:transparent;font-weight:normal;font-style=
:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;">=
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;}</span></p><p dir=3D"ltr" style=3D"l=
ine-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size=
:15px;font-family:Arial;color:#000000;background-color:transparent;font-wei=
ght:normal;font-style:normal;font-variant:normal;text-decoration:none;verti=
cal-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;operator bool() =
{</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-=
bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;=
background-color:transparent;font-weight:normal;font-style:normal;font-vari=
ant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return pos&lt;p4; //still </span><s=
pan style=3D"font-size:15px;font-family:Arial;color:#000000;background-colo=
r:transparent;font-weight:normal;font-style:normal;font-variant:normal;text=
-decoration:none;vertical-align:baseline;">hasn't ended<br></span></p><p di=
r=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><spa=
n style=3D"font-size:15px;font-family:Arial;color:#000000;background-color:=
transparent;font-weight:normal;font-style:normal;font-variant:normal;text-d=
ecoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &n=
bsp;}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000=
000;background-color:transparent;font-weight:normal;font-style:normal;font-=
variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; &nbsp;iterator &amp;operator=3D(const iterator&amp;) =3D=
 delete;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;=
margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#=
000000;background-color:transparent;font-weight:normal;font-style:normal;fo=
nt-variant:normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; &nbsp;friend fib_even;</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font=
-size:15px;font-family:Arial;color:#000000;background-color:transparent;fon=
t-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;=
vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;};</span></p><p dir=3D"ltr" st=
yle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"f=
ont-size:15px;font-family:Arial;color:#000000;background-color:transparent;=
font-weight:normal;font-style:normal;font-variant:normal;text-decoration:no=
ne;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;int n;</span></p><p dir=3D"=
ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span sty=
le=3D"font-size:15px;font-family:Arial;color:#000000;background-color:trans=
parent;font-weight:normal;font-style:normal;font-variant:normal;text-decora=
tion:none;vertical-align:baseline;">public:</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font=
-size:15px;font-family:Arial;color:#000000;background-color:transparent;fon=
t-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;=
vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;fib_even(int n) : n(n) {}</spa=
n></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom=
:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;backgr=
ound-color:transparent;font-weight:normal;font-style:normal;font-variant:no=
rmal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;iter=
ator begin() {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-to=
p:0pt;margin-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;c=
olor:#000000;background-color:transparent;font-weight:normal;font-style:nor=
mal;font-variant:normal;text-decoration:none;vertical-align:baseline;"> &nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;return iterator(n);</span></p><p dir=3D"l=
tr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span styl=
e=3D"font-size:15px;font-family:Arial;color:#000000;background-color:transp=
arent;font-weight:normal;font-style:normal;font-variant:normal;text-decorat=
ion:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;}</span></p><p dir=3D=
"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span st=
yle=3D"font-size:15px;font-family:Arial;color:#000000;background-color:tran=
sparent;font-weight:normal;font-style:normal;font-variant:normal;text-decor=
ation:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;iterator end() {</s=
pan></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bott=
om:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000;back=
ground-color:transparent;font-weight:normal;font-style:normal;font-variant:=
normal;text-decoration:none;vertical-align:baseline;"> &nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp; &nbsp;return iterator();</span></p><p dir=3D"ltr" style=3D"line-=
height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:15p=
x;font-family:Arial;color:#000000;background-color:transparent;font-weight:=
normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-=
align:baseline;"> &nbsp;&nbsp;&nbsp;}</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt;"><span style=3D"font-size:1=
5px;font-family:Arial;color:#000000;background-color:transparent;font-weigh=
t:normal;font-style:normal;font-variant:normal;text-decoration:none;vertica=
l-align:baseline;">};</span></p><br><span style=3D"font-size:15px;font-fami=
ly:Arial;color:#000000;background-color:transparent;font-weight:normal;font=
-style:normal;font-variant:normal;text-decoration:none;vertical-align:basel=
ine;"></span><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin=
-bottom:0pt;"><span style=3D"font-size:15px;font-family:Arial;color:#000000=
;background-color:transparent;font-weight:normal;font-style:normal;font-var=
iant:normal;text-decoration:none;vertical-align:baseline;">So, what do you =
think?</span></p>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />
&nbsp;<br />
&nbsp;<br />

------=_Part_2129_3026738.1372297258221--

.
