-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add c++11 flag #2035
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
Add c++11 flag #2035
Conversation
I don't quite get how adding this option saves compatibility with old compilers. As soon as we introduce some code that uses C++11 features, it will be impossible to compile the library without turning Also, I'd avoid bumping minimum required CMake version. Ubuntu 14.04 comes with CMake 2.8 and people are still using it. For example, Travis only recently switched to 14.04. ROS Indigo requires 14.04. |
@taketwo , The code. that uses C++11 will be protected with HAVE_CXX11 |
OK, fair enough. But then we need to maintain two implementations, one for the old standard, and one for the new? |
I suppose, that it will be a transitional stage before movement to C++11 |
I don't think we have enough manpower for maintaining both, therefore my opinion is to defer the transition to c++14 to when this comes enabled by default by the compilers. In gcc it already does and clang jumped into the bandwagon and should implement the same in it's major version 6, which should come out in 6 months to a year. By then I would start doing the full transition. |
I was surprised to see an auto_ptr in the code, and opened a pull request... I should have checked the issues first. Now I'm even more surprise C++11 isn't a requirement. |
+1 for C++11 support |
+1 for C++14 now and ditching boost altogether. |
Ditching Boost entirely won't happen, but we'll reduce the number of things we use from them. |
C++11 is a must nowadays. I don't understand why there is still a discussion about it. Maintaining two versions is undoable, having pragmas protecting the C++11 code is also not doable since the code base is big and it would become quickly horrible. Just move to C++11 from the next version; PCL will be available without C++11 for the older versions and thats it. Delaying this transition will only make the library less efficient, grow slower and have less people contribute to it. |
@taketwo & @SergioRAgostinho from the comment above:
Ubuntu 18.04 LTS has the above compilers available... and they enable C++14 out of the box. |
For me, yes. I think we should enable C++14 as soon as PCL 1.9.0 is shipped. |
Superseded by #2382. |
The flag should give the great opportunity for contributors to use such c++11 features such as rvalue references, lambdas and lots of other cool things.
Also, it will save compatibility with old compilers (for now).
To make the check for C++11 easy, I make the required cmake version 3.1 (It has CXX_STANDARD property). I don`t think, that anyone uses cmake 2.8 with latest pcl versions.
Also I added HAVE_CXX11 definition to pcl_config.h
#1638
It will be the base for checking the compile features available.