What C++ standard follow the version gcc 4.6.4?

I'm having some problems with the type "auto". So I'm wondering if I am using a gcc version previous to the standard C++11.

I checked the the gcc version on my computer:
% gcc -v
> gcc version 4.6.4

But I don't find what standard follow this version:
- C++98 (ISO/IEC 14882:1998) is the first edition.
- C++03 (ISO/IEC 14882:2003) is the second edition and often considered a bugfix, but it has many changes.
- C++11 is the third edition.
...

Can anybody tell me?
Thanks.
GCC versions and C++ versions don't have no useful relationship.

The problem is that the GCC prefers to default to an older version of C++. You need to explicitly instruct it to compile using a modern version.

% gcc -std=c++14 ...

Hope this helps.
GCC 4.6.4 support much of C++11, but not everything.

https://gcc.gnu.org/projects/cxx-status.html#cxx11

Note that the -std=c++11 flag were not available until GCC 4.7 so you'll have to use -std=c++0x instead. If you are serious about using C++11 you probably want to use a later version of GCC.
Last edited on
Check from the manual of your installed gcc
% man g++

the description of the option -std. Each valid value for the option is described there and the default is stated too.

For many versions of GCC the default for C++ was C++03 with GNU extensions.
Topic archived. No new replies allowed.