mardi 17 août 2021

Warning: range-based for loop is a C++11 extension

While trying to compile a simple range based for loop on MacOS Big Sur, I got this warning:

warning: range-based for loop is a C++11 extension [-Wc++11-extensions]

I tried using clang++ and g++ but both gave the same warning. Is there a way to always compile with C++11 without having to use -std=c++11 and without using aliases?

Edit: The reason I would prefer not to use -std=c++11 is because I want the compiler to default to C++11 or higher.

Aucun commentaire:

Enregistrer un commentaire