Feature #3076
closedC++14 support
Added by Davide Pesavento over 9 years ago. Updated over 6 years ago.
100%
Description
GCC 6 will change the default C++ dialect from -std=gnu++98
to -std=gnu++14
.
We should start adding C++14 support to ndn-cxx and dependent projects, although I recommend we use -std=c++14
to prevent using non-portable GNU extensions.
Most language features were added either in gcc-4.9 or gcc-5, so we will be able to use them unconditionally only after we drop support for Ubuntu 14.04, which can happen after Ubuntu 18.04 is released in April 2018.
Updated by Junxiao Shi over 9 years ago
- Description updated (diff)
I agree with this idea in general.
clang 3.4 has implemented most C++14 features so it will work in OSX.
gcc49 comes with Ubuntu 14.10 and above, so it works in 15.04 only.
What C++14 features are particularly useful for ndn-cxx? Do they have fallback for older compilers (in Ubuntu 14.04 and 12.04)?
I see the following are useful:
make_unique
; fallback: backport[[deprecated]]
with rationale string; fallback: gcc deprecated attribution without rationale- heterogeneous lookup in associative containers; fallback: Boost multi index container
Updated by Junxiao Shi over 9 years ago
- Related to Feature #3093: Backport make_unique added
Updated by Davide Pesavento over 8 years ago
How do we want to proceed here?
My suggestion is:
For all applications (NFD, ndn-tools, NLSR if the maintainers are interested, etc..) we use whatever C++ dialect is the default for the current compiler (except that we use
-std=c++NN
instead of-std=gnu++NN
), with a minimum of-std=c++11
if the default is pre-C++11.For ndn-cxx we can do the same as above, or we can always force
-std=c++11
even if the compiler is more capable. I don't expect any ABI incompatibilities between C++11 and C++14, so we should be safe either way.
In any case, we cannot use any C++14 features in the code (unless a fallback is provided) because we still have to support gcc-4.6.
Updated by Junxiao Shi over 8 years ago
I don't think the benefit-cost ratio is favorable for enabling C++14 now.
Per platform policy, Ubuntu 12.04 compatibility will be dropped after Ubuntu 16.04 release, which is about 2 months away.
We can consider enabling C++14 at that time.
Updated by Davide Pesavento over 8 years ago
Sure, I'm not in a rush to implement this. Just wanted to start the discussion.
Note that even gcc-4.8 contains very few C++14 features, so we still wouldn't be able to use it if we dropped support for earlier compilers. But we'd gain complete C++11 support, which would be pretty nice.
Updated by Davide Pesavento over 8 years ago
- Tracker changed from Task to Feature
Updated by Davide Pesavento about 8 years ago
- Blocked by Task #3810: Jenkins: Ubuntu 16.10 slave added
Updated by Davide Pesavento almost 8 years ago
- Related to Feature #3963: Backport operator""s added
Updated by Davide Pesavento almost 8 years ago
- Related to Feature #3962: Backport ostream_joiner added
Updated by Alex Afanasyev almost 8 years ago
I haven't worked on this and doubt would have time anytime soon. Eric can try to instantiate 16.10 vagrant slaves https://github.com/cawka/ndn-jenkins-slaves in another environment and try to debug, if there is enough capacity available.
Updated by Davide Pesavento over 7 years ago
- Blocked by Task #4002: Jenkins: Ubuntu 17.04 slave added
Updated by Eric Newberry over 7 years ago
I actually built ndn-cxx and NFD with C++14 (-std=c++14
) using GCC 6 on Ubuntu 16.10 back in January and didn't encounter any compilation issues. I didn't test them, however.
Updated by Davide Pesavento over 7 years ago
- Status changed from New to In Progress
- Assignee set to Davide Pesavento
- Target version set to v0.6
Updated by Davide Pesavento about 7 years ago
- Description updated (diff)
- Status changed from In Progress to Feedback
- Assignee deleted (
Davide Pesavento) - Target version deleted (
v0.6)
I won't have time to work on this for now.
It might make sense to simply wait until we can drop Ubuntu 14.04 support. At that point we would be able to require gcc >= 5 and switch to C++14 unconditionally.
Updated by Davide Pesavento almost 7 years ago
- Blocked by Task #4462: Drop support for Ubuntu 14.04 added
Updated by Davide Pesavento over 6 years ago
- Project changed from ndn-cxx to NFD
- Category changed from Build to Build
- Status changed from Feedback to New
- Assignee set to Davide Pesavento
Updated by Davide Pesavento over 6 years ago
- Priority changed from Normal to Low
Updated by Davide Pesavento over 6 years ago
- Status changed from New to In Progress
- Target version set to v0.7
Updated by Davide Pesavento over 6 years ago
- Status changed from In Progress to Code review
- % Done changed from 50 to 100
Changes have been uploaded for ndn-cxx, NFD, ndn-tools, ChronoSync, NLSR, ndn-traffic-generator, and repo-ng.
Anything else that needs to be moved to C++14?
Updated by Junxiao Shi over 6 years ago
Missing: IntegrationTests install_helpers/tools/Makefile
Updated by Junxiao Shi over 6 years ago
Missing: patch for ndns. It works before but does not work after.
Missing: pull request for ndnmapDataCollector, to avoid problems upon next release.
Other patches are good.
Updated by Davide Pesavento over 6 years ago
- Status changed from Code review to Closed
Updated by Junxiao Shi over 6 years ago
- Status changed from Closed to Feedback
Missing: pull request for ndnmapDataCollector, to avoid problems upon next release.
This one is still missing.
Updated by Davide Pesavento over 6 years ago
- Status changed from Feedback to Closed