policy on c++11 in source code

Nicolás Alvarez nicolas.alvarez at gmail.com
Tue Oct 18 02:11:51 UTC 2011


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.

-- 
Nicolas




More information about the KDevelop-devel mailing list