Project

General

Profile

Actions

Feature #3076

closed

C++14 support

Added by Davide Pesavento over 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Low
Category:
Build
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

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.


Related issues 6 (0 open6 closed)

Related to ndn-cxx - Feature #3093: Backport make_uniqueClosedDavide Pesavento

Actions
Related to ndn-cxx - Feature #3963: Backport operator""sAbandoned

Actions
Related to ndn-cxx - Feature #3962: Backport ostream_joinerClosedDavide Pesavento

Actions
Blocked by NFD - Task #3810: Jenkins: Ubuntu 16.10 slaveAbandoned

Actions
Blocked by NFD - Task #4002: Jenkins: Ubuntu 17.04 slaveClosedEric Newberry

Actions
Blocked by NFD - Task #4462: Drop support for Ubuntu 14.04ClosedDavide Pesavento

Actions
Actions #1

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
Actions #2

Updated by Junxiao Shi over 9 years ago

Actions #3

Updated by Davide Pesavento almost 9 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.

Actions #4

Updated by Junxiao Shi almost 9 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.

Actions #5

Updated by Davide Pesavento almost 9 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.

Actions #6

Updated by Davide Pesavento over 8 years ago

  • Tracker changed from Task to Feature
Actions #7

Updated by Davide Pesavento about 8 years ago

  • Blocked by Task #3810: Jenkins: Ubuntu 16.10 slave added
Actions #8

Updated by Davide Pesavento almost 8 years ago

Actions #9

Updated by Davide Pesavento almost 8 years ago

Actions #10

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.

Actions #11

Updated by Davide Pesavento almost 8 years ago

  • Blocked by Task #4002: Jenkins: Ubuntu 17.04 slave added
Actions #12

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.

Actions #13

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
Actions #14

Updated by Davide Pesavento over 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.

Actions #15

Updated by Davide Pesavento almost 7 years ago

  • Blocked by Task #4462: Drop support for Ubuntu 14.04 added
Actions #16

Updated by Davide Pesavento almost 7 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
Actions #17

Updated by Davide Pesavento almost 7 years ago

  • Priority changed from Normal to Low
Actions #18

Updated by Davide Pesavento over 6 years ago

  • Status changed from New to In Progress
  • Target version set to v0.7
Actions #19

Updated by Davide Pesavento over 6 years ago

  • % Done changed from 0 to 50
Actions #20

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?

Actions #21

Updated by Junxiao Shi over 6 years ago

Missing: IntegrationTests install_helpers/tools/Makefile

Actions #22

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.

Actions #23

Updated by Davide Pesavento over 6 years ago

  • Status changed from Code review to Closed
Actions #24

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.

Actions #25

Updated by Davide Pesavento over 6 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF