lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Updating code to use C++11


From: Vadim Zeitlin
Subject: [lmi] Updating code to use C++11
Date: Mon, 25 Jan 2016 02:31:50 +0100

 Hello,

 Now that we're close to making the build system work using a modern C++11
compiler, I'd like to ask about the next steps -- if there are going to be
any.

 Personally I'd like to start at least the following new C++11 features in
the code:

- "auto" for the variables to avoid duplicating the type of the RHS
- short loop syntax for the "for each" loops
- lambdas for the wxWidgets event handlers
- nullptr instead of 0 or NULL for type safety
- "override" to make sure methods are really overridden when meant to
- "= delete" instead of "lmi::uncopyable<>"

 Of this, I think, only the first one can be potentially controversial, but
please let me know if I'm wrong and if you have anything against the other
ones and/or also agree with the first one or, at least, don't disagree with
it violently enough to make any attempt to convince you to start using
"auto" doomed in advance.


 Assuming we do agree on using to start at least some of these features in
the new code, the question is what to do about the existing code. The path
of the least resistance is to keep it unchanged, but I don't, and I suspect
you wouldn't, like the discrepancy between the "old" and "new" code which
would arise in this case. So I'd like to propose to change the existing
code to follow the new C++11 rules too. Obviously, this will take some
time, although perhaps not as much as one might think, thanks to the new
clang-based tools allowing to find the occurrences of old style constructs
and replace them with the new ones, but I still believe it would be worth
it.

 What do you think?
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]