Yes, you typically set this in a Makefile:
CXXFLAGS=-std=c++11
One layer above you can also detect a suitable compiler via autoconf
, cmake
or whichever other meta-buildtool you might deploy.
You of course play games as define g++11
as g++ -std=c++11
but such set-ups are not portable.
g++-6.* will default to c++14 so at some this switch will be implicit. But it might take a really long time for all those RHEL and CentOS boxen with g++-4.4.* to disappear. Those may not even handle your current project…
Related Posts:
- no default constructor exists for class
- Getting error: ISO C++ forbids declaration of with no type
- expected constructor, destructor, or type conversion before ‘(’ token
- Creating an instance of class
- Here is some error with my .h file which show [Error] unterminated #ifndef when I include my class template in it
- What does the explicit keyword mean?
- Expression must have class type
- Struct Constructor in C++?
- C++ struct constructor
- c++ “Incomplete type not allowed” error accessing class reference information (Circular dependency with forward declaration)
- What does the explicit keyword mean?
- Why is enum class preferred over plain enum?
- Why am I getting this redefinition of class error?
- Single class has a Class Redefinition Error
- C++ Linked List Node with class
- Inheriting constructors
- (->) arrow operator and (.) dot operator , class pointer
- Inheriting constructors
- Separating class code into a header and cpp file
- Pointer to incomplete class type is not allowed
- Why am I getting this redefinition of class error?
- C++ error: no matching constructor for initialization of
- Getting error “a nonstatic member reference must be relative to a specific object” while both member are in the same class
- Error “C++ requires a type specifier for all declarations whilst defining methods”
- What are the differences between struct and class in C++?
- error C2011: ” : ‘class’ type redefinition
- The compiler is complaining about my default parameters?
- C++ Linked List Node with class
- “used without template parameters”
- QltAW.png
- Error: No instance of constructor matches the argument list
- C++ template constructor
- C++ Class ‘undeclared identifier”
- c++ “Incomplete type not allowed” error accessing class reference information (Circular dependency with forward declaration)
- Base class undefined
- expected identifier before string constant
- Warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11?
- What is the meaning of a C++ Wrapper Class?
- Does C++11 have C#-style properties?
- G++ undefined reference to class::function
- In C++ can constructor and destructor be inline functions?
- When is it safe to call this-> in constructor and destructor
- C++ Cannot call constructor directly in small example
- expected primary-expression before ‘]’ token
- error C2039: ‘string’ : is not a member of ‘std’, header file problem
- istream and ostream problem – C++
- Struct with template variables in C++
- error: no member function declared in class
- Error: invalid use of member in static member function
- Pause Console in C++ program
- Why the switch statement cannot be applied on strings?
- How to dynamically allocate arrays in C++
- How to convert string to char array in C++?
- How can I convert a std::string to int?
- Why is “using namespace std;” considered bad practice?
- What is a lambda expression in C++11?
- Incomplete Type Is Not Allowed
- how to implement quick sort algorithm in C++
- C++ Vector of pointers
- How do I reverse a C++ vector?
- Is there a C++ decompiler?
- wntdll.pdb not loaded – Can’t see the exception
- Difference between const reference and normal parameter
- Argument list for class template is missing
- Fastest way to check if a file exist using standard C++/C++11,14,17/C?
- Random number c++ in some range
- “g++” is not recognized as an internal or external command, MinGW
- Compiling a C++ program with gcc
- Get Unix timestamp with C++
- Class prototyping
- How to dynamically allocate an array of pointers in C++?
- How do I compile C++ to JavaScript in a browser?
- Is the sizeof(some pointer) always equal to four?
- How do you initialise a dynamic array in C++?
- What are the distinctions between the various symbols (*,&, etc) combined with parameters?
- Integer to hex string in C++
- Comparison of C++ unit test frameworks
- What is the difference between .cc and .cpp file suffix?
- C++ error: object of abstract class type is not allowed: pure virtual function has no overrider
- Correct way to work with vector of arrays
- What’s the difference between nexti and stepi in gdb?
- How to get current time in milliseconds?
- Resizing dynamic array in c++
- C++ – Nested include – Avoiding ‘include nested too deeply error’
- c++ error c2015: too many characters in constant
- Splitting a C++ std::string using tokens, e.g. “;”
- Py_Initialize fails – unable to load the file system codec
- C++ pass an array by reference
- error LNK2019: unresolved external symbol “” referenced in function
- Undefined reference to a static member
- variable or field declared void
- Invalid conversion from ‘char’ to ‘const char *’
- How do I deal with “signed/unsigned mismatch” warnings (C4018)?
- Creating folders in C++
- Unrecognizable template declaration/definition
- heap corruption detected | C++
- Update g++ but still old version
- module unsafe for SAFESEH image C++
- Why are there two different getline() functions (if indeed there are)?
- Whats the difference between UInt8 and uint8_t