policy on c++11 in source code
Andreas Pakulat
apaku at gmx.de
Tue Oct 18 06:49:53 UTC 2011
On 17.10.11 23:11:51, Nicolás Alvarez wrote:
> 2011/10/17, Henry Miller <hank at millerfarm.com>:
> > Do we wish to allow C++11 constructs in kevelop code at this time? This is
> > the new standard, and it has a lot of nice things, but not all systems are
> > ready for it yet, so I think we might want to hold off on requiring to for
> > our
> > source code.
> >
> > I'm trying to compile git on freebsd, which uses an old version of gcc (4.1)
> > by default, for licensing reasons: GPLv3 is not allowed. CLang is the long
> > term replacement, but it isn't quite ready.
> >
> > I've seen a few errors where >> was used to close templates.
> > QVector<QPair<foo,bar>> for example. Adding a space in the >> is trivial,
> > and
> > allows support for older compilers. I can send patches, but only if they
> > are
> > likely to be accepted.
> >
> > Don't be confused, I think we should support all the features for writing
> > code. However I think it best to wait a few years before using those new
> > features ourselves.
>
> With gcc, KDevelop is being compiled with -std=c++0x (if supported!)
> in order to get std::unordered_map. If the compiler is old or not gcc,
> then the buildsystem disables c++0x and uses an alternative to
> unordered_map.
>
> The problem is that this means most of us are compiling KDevelop with
> c++0x enabled, and if someone *accidentally* uses C++0x features, such
> as >> for templates, we won't even *notice*, since the compiler won't
> complain.
>
> Feel free to post patches to make KDevelop compilable without C++0x.
> Speaking for myself, I would accept them.
>
> ...unless a project maintainer speaks up deciding that c++0x is
> officially allowed in the codebase.
I'm with Nicolas here (whatever my opinion counts for at this point :),
in particular I'm pretty sure that the '>>' closing was just an accident
not noticed due to not seeing an error produced by it.
Personally I wasn't even aware that C++2011 supports the closing without
the whitespace :)
Andreas
More information about the KDevelop-devel
mailing list