Boost logo

Boost :

Subject: Re: [boost] Boost.Fiber mini-review September 4-13
From: Agustín K-ballo Bergé (kaballo86_at_[hidden])
Date: 2015-09-05 00:15:33


On 9/4/2015 11:10 PM, Oliver Kowalke wrote:
> 2015-09-04 21:36 GMT+02:00 Agustín K-ballo Bergé <kaballo86_at_[hidden]>:
>
>>
>> What additional indirections would deriving from a base class introduce?
>>
>
> depends on the inheritance type
>
> - private inheritance from helper == 'implemented-n-terms-of': functions of
> helper are not part of the public interface (future/promise has to invoke
> helper functions internally)

That's not entirely truthful:

     struct base {
       void foo();
       void bar();
     };

     struct derived : private base {
       using base::bar; // bar is part of the public interface now
     };

     derived d;
     d.foo(); // error, foo is private
     d.bar(); // fine

> - public inheritance from helper == 'is-a': functions of helper are part of
> the public interface, but I don't like to track a future as the same as a
> promise (or packaged_task)
> => void foo( helper &) could be called for future and promise

I fail to see how this is relevant. You'd have `future_base`,
`promise_base`, etc. There is no "tracking" issue in sight.

> so I believe using template specializationonly is reasonable

No, sorry, that's just unreasonable; it goes against some pretty
fundamental design principles. I must have failed to explain myself
correctly, please don't hesitate to keep asking if I am unclear.

Regards,

-- 
Agustín K-ballo Bergé.-
http://talesofcpp.fusionfenix.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk