Abdelrazak Younes <you...@lyx.org> writes: | On Tue, Oct 23, 2012 at 2:27 PM, Lars Gullik Bjønnes <lar...@gullik.org> wrote: >> 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) { >> ... >> } >> >> and >> >> std::vector<std::pair<string, string> > & vs = getVector(); >> >> would be replaced with: >> >> auto & vs = getVector(); > | That would be nice indeed but we would then require a recent version | of gcc and msvc. Not a real problem for msvc but gcc is a problem if | we want to support older distribution.
Not too much. Quite a bit of C++11 is supported in compilers back to gcc gcc 4.3, but not really useful until 4.6. (auto in 4.5, range based for in 4.6). CentOS 4 has gcc 4.4 (as gcc4) but is rather ancient in itself. I am not suggesting to begin using C++11 now, but in about a year it should be really possible. msvc 11 has ok support I think, same with clang. Do you have other compilers that people use regularly? -- Lgb