Philippe A. Bouchard wrote:

[...]

>>>> It's pretty good.  "ip_assign_op_switch" is faster than
>>>> "ip_offset_iterator" but must be explicit?
>>>>
>> I was afraid of that(as indicated in 6.2.2 of the .html file);
>> however, ip_offset_iterator
>> is more "robust" (as indicated in 6.2.3 item 2).  Maybe some boost
>> template guru's
>> could figure a way to hack a "virtual template member function" as
>> mentioned in
>> item 4 of 6.1.2.
>
> A "virtual template member function".  It looks like another virtual
> table will have to be gradually constructed at compile time, just
> like what I did last year with ptr<T, complex_tree>:
> http://groups.yahoo.com/group/boost/files/ptr/ptr.hpp.old.  The table
> could return the address of the template member function given some
> class X and template parameter Y.

Here is a better example:
http://groups.yahoo.com/group/boost/files/shifted_ptr/virtualtemplate.cpp

Ouputs (compiled with gcc 3.0.4):
Normal calls:
void A::foo() [with U = int]
void B::bar() [with U = int]
Virtual calls:
void A::foo() [with U = int]
void B::bar() [with U = int]



Philippe




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to