Boost logo

Boost Users :

Subject: Re: [Boost-users] zip_iterator documentation: probably malformed example
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2011-09-05 10:05:23


On 05.09.2011 12:30, Krzysztof Żelechowski wrote:
> Dave Abrahams wrote:
>
>> on Sat Sep 03 2011, Krzysztof Żelechowski<giecrilj-AT-stegny.2a.pl>
>> wrote:
>>
>>> At
>>> [http://www.boost.org/doc/libs/1_47_0/libs/iterator/doc/zip_iterator.html
>>> Zip Iterator]:
>>>
>>> is:: {{{zip_it->get<0>() = 42.0;}}} (syntax error)
>>> works:: {{{zip_it -> template get<0> () = 42.0;}}}
>> Not a bug, IMO. There's no reason to think we're writing in a template
>> here, and I see no reason to complicate the example by making that
>> assumption.
>>
> GNU C++ treats the sample code as a syntax error. Template member functions
> should be called preceded with the template keyword. I do not understand
> what you mean by ''writing in a template''.
>
If you hadn't inserted the example code into a function where zip_it is
of dependent type, but instead is an instance of some concrete class,
the error wouldn't have appeared.

Sebastian


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