Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using GCC's C++0x mode in production?

Tags:

c++

gcc

c++11

mingw

Is anyone using the GCC 4.4.0 C++0x support in production? I'm thinking about using it with the latest MinGW, but I'm not sure if it's mature enough.

I'm interested in:

  • TR1 support
  • auto
  • initializer lists
like image 584
rpg Avatar asked Sep 12 '09 11:09

rpg


3 Answers

IMHO, TR1 support and auto are safe to use. In the case of auto it was one of the first features to be included into the standard and is a relatively small change to the language. I would therefore have no problem using it.

I would be a bit more hesitant about using initializer lists. On some other forums (eg. comp.lang.c++.moderated) there are questions about their behaviour and its possible that they may change closer to the release of the standard.

like image 143
Richard Corden Avatar answered Nov 11 '22 13:11

Richard Corden


I'm not using GCC 4.4.0 C++0x support in production but I'm using the TR1 features with the help of the Boost Library http://www.boost.org/.

The Boost Library is well tested and often used in production environments. If you convert to the C++0x standard later the only thing you have to do is changing your include Directives http://www.boost.org/doc/libs/1_40_0/doc/html/boost_tr1.html.

In my opinion it's currently better to use the Boost Library until the standard is finished. It's a much more compiler independent way.

like image 31
Maximilian Schweitzer Avatar answered Nov 11 '22 12:11

Maximilian Schweitzer


MinGW simply won't compile with '-std=c++0x'. Strange enough, '-std=gnu++0x' works. Anyway it seems buggy and I won't count on it.

like image 2
gxx Avatar answered Nov 11 '22 14:11

gxx