On Wed, 2013-06-26 at 11:33 +0100, Reece Dunn wrote:I guess it should be const auto. But otherwise, the change seems good to
> In the server_without_bus example, the type is changed from
> `Glib::ustring` to `char *` in:
>
> -static Glib::ustring introspection_xml =
> +static auto introspection_xml =
> "<node>"
me. We don't actually use the ustring API on that.
> auto should only be used:It avoids the person having to think about the actual type name, which
>
> 1/ if it is shorter (e.g. std::unordered_map<Glib::ustring,
> Glib::ustring>::const_iterator)
>
> 2/ if the deduced type matches the variable type
>
>
>
> e.g. declaring the `GPid` type `auto` does not buy you anything in
> terms of improved readability.
seems useful, though I guess it's a matter of taste. My opinion about
that changes day to day.
Is there any official discouragement from using it in this way?