policy on c++11 in source code

Milian Wolff mail at milianw.de
Tue Oct 18 10:39:45 UTC 2011


On Tuesday 18 October 2011 08:49:53 Andreas Pakulat wrote:
> 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 :)

Hehe, I bet the one who introduced it used KDevelop master as that one 
supports this new syntax as well and hence you don't even see the error there 
;-)

@Henry: nice catch, I'm all for fixing this for the sake of the BSD people.

Is there any ETA btw. on when we can expect people to use clang on BSD?

bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20111018/e2c4dd8e/attachment.sig>


More information about the KDevelop-devel mailing list