Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++11? #73

Open
bchretien opened this issue Sep 24, 2014 · 5 comments
Open

C++11? #73

bchretien opened this issue Sep 24, 2014 · 5 comments

Comments

@bchretien
Copy link
Member

cc @thomas-moulard

C++14 is out, and the urge to use C++11 features is getting strong. What is currently stopping us from moving to C++11? Ubuntu 12.04's GCC? Most features seem to be available with GCC 4.6, and that may be all we need at first.

@thomas-moulard
Copy link
Member

Mainly ABI compatibility, compiler quality and compatibility with old platforms.
C++0x is still considered "experimental" in GCC.
Cf http://stackoverflow.com/questions/20373626/why-c11-compiler-support-still-requires-a-flag/20373913#20373913

For Ubuntu 12.04 in particular the features may be here but I am really not sure if it is reasonable to use them or not due to potential bugs. Personally, I installed gcc 4.8 from a PPA since I started using C++11.
It may not be an acceptable solution for people linking against system libraries though.

However I do know how painful it is not to use C++11 so one possibility is to add optional C++11 features (compiled if enabled).

Another possibility is to switch anyway. I am not against it but it is better to confirm with people at LAAS whether or not it is acceptable for them.

@bchretien
Copy link
Member Author

I just found a nice summary of C++11 features and minimum GCC versions: https://gcc.gnu.org/projects/cxx0x.html

I guess the only question is: what is the lowest version of GCC we're supposed to support? The one in 12.04? And then check if the features we could use are well supported with that version (we could even list the features somewhere).

@thomas-moulard
Copy link
Member

I don't think there is a good answer to this question.

As long as GCC default behavior is not C++11 in a relatively reasonable proportion of Linux distributions, it won't be a "free move". I.e. users will come and complain because it will break their setup.

So again, I am not against it but my advice is: if we want to make it, let's make it optional first.
And let's think of the gain w.r.t to the increase cost of development before.

For me, optional features could be:

  • Move constructors
  • Building functions from lambdas.
  • constexpr when possible

@bchretien
Copy link
Member Author

Some other useful features that we could use:

  • Variadic templates
  • Template aliases

As for the increased cost of development, this can be done incrementally from the moment we make the move (unless there's some very good reason to move as much as possible right away), i.e. new features/fixes can use C++11 features if it is relevant.

Also, I would need to check if the CUDA compiler/parser doesn't explode with the C++11 features we would choose, since C++11 support is experimental and undocumented, and nvcc may include some RobOptim headers.

@bchretien
Copy link
Member Author

We are currently working on some really nice features that would be painful to implement without C++11 (variadic templates saving the day), so this discussion may be revived soon.

@bchretien bchretien mentioned this issue Jun 23, 2015
7 tasks
bchretien referenced this issue Sep 18, 2015
We kept the old API for backwards compatibility (for now...).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants