jeudi 10 novembre 2022

C++11 with Xcode

ALL,

I am trying to compile following code (from header file):

class Foo
{
public:
    auto &GetString() const { return m_str1; }
private:
    std::wstring m_str1;
};

On the Mac with Xcode it gives following:

'auto' return without trailing return type; deduced return types are C++14 extension.

As far as I know auto is C++11 feature and shouldn't need anything from C++14.

What am I missing?

TIA!!

Aucun commentaire:

Enregistrer un commentaire