Search code examples
c++gccc++11production-environment

Using C++11 in a production environment with GCC


C++11 provides us with a lot of new great and immensly useful tools. GCC support of C++11 has already made good progress. So I have thought about when to switch to C++11. This question relates to gcc only, I do not expect to compile my (our) code with any other compiler.

Would you (did you) switch to C++11 before gcc supports the entire C++11 standard to benefit from the features already implemented? Would you still do this in a production environment where stability and correctness is very important? Do you think it would be a reasonable approach to allow developers only to use certain C++11 features?

How would you (do you) go about deciding when GCCs C++11 support is ready for a production environment?

(Note: I'm aware of this question, but it specifically relates to gcc 4.4 and is somewhat outdated)


Solution

  • It depends.

    If it were to power my blog or something like this ? Definitely.

    If it were to power a critical service ? Of course not.

    I believe that the support of C++11 is too immature as it is now, to be called production ready.

    You may settle on a version of gcc, but the truth is that because the successive drafts evolved as new problems were discovered and tackled, the code you write now may well be rejected by a later version, or the behavior may change lightly.

    Therefore, I think this judgement truly depends on what you intend to be doing. There is a reason the space shuttle is powered by an old and proven technology: it's a matter of trade-off between ease of development and confidence in the tools.

    It's your judgment, you know your situation better than we do.