zip_iterator documentation: probably malformed example

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;}}}

on Sat Sep 03 2011, Krzysztof Żelechowski
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. -- Dave Abrahams BoostPro Computing http://www.boostpro.com

Dave Abrahams wrote:
on Sat Sep 03 2011, Krzysztof Żelechowski
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''.

On 05.09.2011 12:30, Krzysztof Żelechowski wrote:
Dave Abrahams wrote:
on Sat Sep 03 2011, Krzysztof Żelechowski
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
participants (3)
-
Dave Abrahams
-
Krzysztof Żelechowski
-
Sebastian Redl