[C++-sig] wrapping virtual function returning void

David Abrahams dave at boost-consulting.com
Sun Aug 7 15:00:35 CEST 2005


Faheem Mitha <faheem at email.unc.edu> writes:

> On Sat, 6 Aug 2005, Eric Jardim wrote:
>
>> That's easy!
>>
>> struct BaseWrap : Base, wrapper<Base>
>> {
>>   void f()
>>   {
>>    if (override f = this->get_override("f"))
>>       f();
>>    else
>>      Base::f();
>>   }
>>
>>   void default_f() { Base::f(); }
>> };
>
> That's interesting. So, for pure virtual functions, it would look like the 
> version below?
>
> I don't understand what this wrapper is doing, so that makes it more 
> difficult for me to make these deductions.
>
> According to the documentation, it overrides the base class in
> Python. 

I'm pretty sure the documentation only ever talks about overriding
functions and methods, not classes.  What do you really mean to say?

> I assume this is related to the derived class wrappers in Python
> knowing of their derived relationship to the base class wrapper, but
> I'm pretty fuzzy on the details.
>
> If some kind person wants to try to explain it, I'm all ears.

I'm sorry, I don't understand the question yet.

--
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list