[doc] Remove leading asterisks from \code ... \endcode blocks [ci skip]
The asterisks were included as part of the code block which is not what we want.
While at it, also correct the example used for the range-based for
statement (use auto&
instead of const auto&
).