What stable function C ++ 11 can be used safely

What are the features of C++11 that got mature enough that I can start using safely in my projects. I'm talking about GCC , mostly I rarely need Visual Studio. and I obviously don’t want to include in my code a function that requires rewriting in a few months. and should I even start using these features at this very beginning? because everything that we do basically is not c++11 dependent , we can do anything we like in old school methods. why should we start using the power of C ++ 11 at this early stage?

+8
c ++ c ++ 11
source share
2 answers

Finally, the C ++ 11 standard is completed and published, so there will be no more changes. Implementations are still slightly behind and may implement somewhat older versions of C ++ 0x, but you probably won’t notice much difference when they are updated.

C ++ 11 is incompatible with backward compatibility, so the first thing you need to do is start development with compatibility with C ++ 11. GCC has the warning flag “-WC ++ 0x-compat” to help with this. Incompatibilities are quite small, but this should be a problem that will be a problem.

One big incompatibility is that libstdC ++ ABI changes with the transition to C ++ 11, so you also need to make sure that you can handle it.

Once you know that it’s safe to navigate, just start building in C ++ 11. You can gradually use any C ++ 11 features that you find useful when writing new code or changing old code. You might also want to try checking out for obsolete features, such as old exception specifications, and replace them with new materials.

There is a lot of new material, so check out the standard if you can get it or some documentation online. I believe that most of the really interesting material that I want to use directly is in the library. Unfortunately, it seems that current implementations are still lagging behind the most.

+8
source share

You can visit:

http://gcc.gnu.org/projects/cxx0x.html

This link provides C ++ 0x support in different versions of GCC.

I suggest you use C ++ 11 (simply by adding -std = C ++ 0x to the GCC command line). If you're lucky, nothing will change in your code. Even if you are not using any of the features of C ++ 11, you can still take advantage of the performance improvement coming from rvalue references and moving semantics.

0
source share

All Articles