Boost logo

Boost :

From: Simon Buchan (simon_at_[hidden])
Date: 2005-10-11 01:18:31


Robert Ramey wrote:
> Double check that a is polymorphic - that is, that it has at least one
> virtual function. Then get back to us.
>
> Robert Ramey
> Jared McIntyre wrote:
<snip>
>>Also, there is an issue in the documentation. In the "Pointers to
>>Objects of Derived Classes" section, it has example registration code:
>>
>>main(){
>> ...
>> ar.template register_type<derived_one>();
>> ar.template register_type<derived_two>();
>> base *b;
>> ar & b;
>>}
>>
>>I'm guessing that is supposed to be:
>>
>>main(){
>> ...
>> ar.register_type<derived_one>();
>> ar.register_type<derived_two>();
>> base *b;
>> ar & b;
>>}
>
>
> nope, its correct. This is a little known quirk of C++ syntax. Your second
> version won't compile on the most conforming compilers.
>
Not according to Comeau:
"ComeauTest.c", line 16: error: the "template" keyword used for syntactic
           disambiguation may only be used within a template


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