Toolchain support for C ++ 11 standard

I am currently updating my C ++ knowledge to a new standard. It makes me feel like a little kid who just got a terrific toy: I want to play with her all the time, but I don't want to lose my friends because of this.

I participate in several open source projects for which some of the new features will be extremely useful, so I am very interested in using them. My question is how many users can compile C ++ 11 code, for example. What is the speed of adoption of C ++ 11-complete compilers for the general public? Does anyone have related information?

I know that gcc 4.8.1 and clang 3.3 C ++ 11 is complete, but I don't know how many people actually use compilers that are relevant. I know what most codemonkeys really do, but what about the average open source user? Damaging potential users in person and allowing them to update their compilers is not an option.

I know that this question can be criticized / closed in order to be similar to these questions:

  • How do you use C ++ 11 today?
  • Use or not use C ++ 0x functions

I would like to point out that now everything is different, since we are talking about the actual approved standard. I believe that understanding its adoption rate is important in practice for programming.

+7
c ++ c ++ 11
source share
2 answers

You should probably first decide which C ++ 11 you absolutely want to use, and then find the lowest version of the compiler that supports this on the platforms you want to support. Apache has a good overview of the earliest version of each main compiler (gcc, clang, visual C ++, intel, etc.) ..) that supported the various features of C ++ 11.

In my experience, gcc 4.7 and Clang 3.2 are almost completely complemented (with the exception of things like constructor inheritance, which are useful but not game changers). You can get many useful features with gcc 4.6 (but take version 4.6.3 to avoid many errors) or Clang 3.1, which is nice, since gcc 4.6 is also the official Android NDK compiler (if you want to support it).

If you want to support Linux, you can take a look at DistroWatch , where you can see which gcc versions were installed for each version of the distribution. For example. many popular distributions based on Ubuntu have been running gcc 4.7 for almost a year now and are planning to upgrade to gcc 4.8.1 (full version) in future releases.

On Windows there is Nuwen Distro currently running MinGW 4.8.1 (only 32-bit and no threading). Visual C ++ is not suitable for work and will take some time (a year or more?) To find out where gcc 4.8 and Clang 3.3 are.

Even if distributions do not officially support the latest version, there are repositories of private packages (often supported by the same people who also make official packaging) that provide cutting edge. The LLVM project provides ready-made nightly SVN snapshots that allow you to use many of the features of C ++ 14 (in -std=c++1y ). There are no AFAIK night packages for gcc.

On forcing developers to update compilers / distributions. I donโ€™t think itโ€™s such a big deal (but @ArneMertz's point about first talking to them is very good). Virtual machines are an easy installer (~ 45 minutes from end to end), so if you only want to release only a binary product, then go ahead. For users, this is another matter, so if you provide a header-only template library that all regular users should compile, this should make you much more conservative in your transition pace.

+6
source share

I think this is difficult to answer since its a somewhat broad question. You ask about โ€œadoption by the general public,โ€ and it depends on how you define it.

I would say that in most companies the introduction of new compilers is slow, because for large projects, changing parts of the tool chain involves some costs and risks. This is especially true for large and "old" companies. Smaller startups are often more likely to embrace new technologies.

Open source projects, on the other hand, are often made up of people who do entertainment programming and seek to take on new promising things. I am sure that many of your colleagues will feel the same as you. As your user community does not accept new compilers, you cannot say without knowing more about your projects. There are projects and communities that just want the program to work and don't care about new compilers, and there are communities that want to use the latest technology, because it's cool, faster, better, whatever.

Bottom line: ask other participants in your projects to consider adopting a new standard, as well as a community of users of your projects.

+4
source share

All Articles