mercredi 25 novembre 2020

clang compiling to which version of c++ in macOS?

    #include <iostream>
    #include <vector>
    using namespace std;

    int main()
    {
     vector<int> a;
     a.push_back(3);
     vector<int> b = move(a);
     cout<<"b: "<<b[0]<<endl;
    }

As far as I know, "move semantics" is a part of c++11

Output: C++98 (when compiled with clang++ command without any flags)

Then how are the move semantics working??

I know that I can select the particular version of c++ I want to compile to with the -std=c++xx flag, but that's not what I want.

I want to know, what is the default version of c++ to which clang compiles to in macOS ?

Aucun commentaire:

Enregistrer un commentaire