0

I have a requirement to use GCC 4.5.x on a large project. I am trying to interpret the following statement on this page:

Important: GCC's support for C++11 is still experimental. Some features were implemented based on early proposals, and no attempt will be made to maintain backward compatibility when they are updated to match the final C++11 standard.

If I enable C++11 features in 4.5 with -std=c++0x, I need to know that the code will compile correctly on a fully compliant compiler (such as 4.8). In other words, do all (possibly some) C++0x features in 4.5 have the same syntax and semantics as the final C++11 standard?

ThomasMcLeod
  • 7,603
  • 4
  • 42
  • 80
  • 1
    I work with gcc 4.4 up to 4.8 on some projects and I've personally didn't encounter any problems regarding C++11. Can't you compile it with 4.8 as well just to double check? For practically anything you can rely on "if it compiles with 4.5, it compiles with 4.x" with x >= 5. – stefan Jun 27 '13 at 15:16

1 Answers1

1

If I enable C++11 features in 4.5 with -std=c++0x, I need to know that the code will compile correctly on a fully compliant compiler (such as 4.8).

Tough; the passage you cited clearly states that there is no such guarantee.

In other words:

do all (possibly some) C++0x features in 4.5 have the same syntax and semantics as the final C++11 standard?

No.

Go with "some, maybe all" and rely on neither.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
  • The passage says there is no guarantee of backward compatibility to interim features. I'm interested in the converse, that is, whether features implemented in the interim are forward compliant to the final standard. – ThomasMcLeod Jun 27 '13 at 15:59
  • @ThomasMcLeod: Forward compatibility from 4.5 to 4.8 is the same as backward compatibility from 4.8 to 4.5. – Lightness Races in Orbit Jun 27 '13 at 16:04
  • Not exactly, because there have been maintenance releases of 4.5 that could have brought noncompliant features into compliance with the final standard. – ThomasMcLeod Jun 27 '13 at 16:36
  • The last maintenance release of 4.5 was 4.5.4 on July 2, 2012 – ThomasMcLeod Jun 27 '13 at 16:48
  • @ThomasMcLeod: I refer to the most recent release of 4.5, whatever that may be at the time that you query the compatibility. The passage you cite covers it all; simple as that. Besides, maintenance releases typically do not perform the function which you ascribe to them -- the whole point of new minor releases (4.6, 4.7, 4.8) is to implement significant changes, such as large-scale changes to an API or to a standard library implementation. – Lightness Races in Orbit Jun 27 '13 at 16:56