|
Boost Users : |
Subject: Re: [Boost-users] Using Coroutines in the Visitor Pattern (use-case: BGL event visitor)
From: alex (alexhighviz_at_[hidden])
Date: 2016-01-20 04:35:57
>> -----Original Message-----
>> From: Boost-users [mailto:boost-users-bounces_at_[hidden]] On Behalf
>Of
>> Nat Goodspeed
>> Sent: 19 January 2016 21:25
>> To: boost-users_at_[hidden]
>> Subject: Re: [Boost-users] Using Coroutines in the Visitor Pattern
>(use-case: BGL
>> event visitor)
>>
>> On Tue, Jan 19, 2016 at 6:02 AM, alex <alexhighviz_at_[hidden]> wrote:
>>
>> >>> I can see in the documentation that the constructor enters the
>> >>> coroutine-
>> >>function, but it is not clear to me why. Would it not have been neater
>> >>if this was avoided?
[...]
>> >>If the coroutine constructor didn't enter the coroutine-function, the
>> >>first invocation would have to be a special case.
>>
[...]
>I expect the following in the evaluation of the while condition
>
>1.The operator () will enter somefunc().
It is dawning on me now. At the first invocation operator() should enter
somefunc(), whereas at all subsequent invocations it has to re-enter
somefunc(). I suppose enter and re-enter are different operations, hence the
first invocation would be a special case.
Thanks for indulging me.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net