On Tue, Oct 23, 2012 at 02:27:14PM +0200, Lars Gullik Bjønnes wrote:
> lar...@gullik.org (Lars Gullik Bjønnes) writes:
> 
> | Jean-Marc Lasgouttes <lasgout...@lyx.org> writes:
> >
> | | Le 23/10/12 01:21, Lars Gullik Bjønnes a écrit :
> >>> Anyhow... I am going to ditch the hole series. Pick what you want from
> >>> it if anything.
> >>>
> >>> I just cannot stand the hostility.
> >>
> | | Come on. André is bored and he feel happy to be rude like in the good
> | | old days. Nothing really personnal :)
> >
> | I am pretty sure he means is personal, and I just cannot be bothered
> | with it.
> >
> | | Apart from the std:: namespace issue that seems a bit disruptive and
> | | controversial, the other patches make sense to me. Moving away from
> | | tr1 in particular.
> >
> | What I think you should do is to remove the "using namespace std", and
> | add std:: wherever needed except for on string, as that really is all
> | over, and use "using std::string" for that.
> 
> A patch that does exactly that is attached.
> 
> C++11 would make the code look a lot nicer, esp. thru the use of range
> based for, and auto:
> 
>     std::vector<string>::iterator at = somevec.begin();
>     std::vector<string>::iterator end = someved.end();
>     for (; at != end; ++at) {
>         ...
>     }
> 
> would be replaced with:
> 
>     for (auto & s: somevec) {
>         ...
>     }

Range-based for is certainly one of the (scores of) "obviously cool
and useful" features in C++11 (which is in general way more pragmatic
than 98/03) and I am all for using it - once it has been established
that it's supported by all the setups the project cares for. There
is even some chance it is.

Obligatory rude snide remark #1: It is nice to see the iterator-over-all
faction to be back at values, or references.

I also don't mind modest use of "auto", preferably in cases where it is
a chore to write out the full type, such as having to namespace-qualify
it. Using "auto" instead of "int" or such is a bit of a stretch, though.

Obligatory rude snide remark #2: Luckily, having boost::auto has been
outlawed by The Committee.

Note, however, that the proposal to use range-based for is orthogonal to
the one of full namespace qualification, and I'd even argue it goes into
he opposite direction "in spirit".

Obligatory rude snide remark #3: Omitted, for personal reasons.

Andre'

Reply via email to