Mario
Mario

Reputation: 87

VIsual Studio 2013 C++ problems with reference qualifiers

I found a lot of information in the internet about Reference qualifiers, and also I found that reference qualifiers are new to C++ 11, and are not implemented in all compilers yet. But I was unable to find any information for Visual Studio 2013, and reference qualifier. Can someone please help me with this matter ? Is it reference qualifiers in Visual Studio 2013, and should i perform any additional steps?

Also I have the following code:

    virtual AddOns* clone() const &
    {
        return new AddOns(*this);
    }

    virtual AddOns* clone() &&
    {
        return new AddOns(std::move(*this));
    }

Visual Studio 2013 returns this error on the following code: Error 1 error C2143: syntax error : missing ';' before '&'

And I can not find any information how to correct it. Could some please help me?

Thank you in advance for your answers.

Upvotes: 1

Views: 544

Answers (1)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385264

The Visual Studio C++11 support table clearly states that reference qualifiers have not been implemented yet, in a formal release. That includes Visual Studio 2013.

I have been unable to find confirmation in the release notes for the various Visual Studio "14" and 2015 previews that reference qualifiers are available in those previews (and therefore in the forthcoming Visual Studio 2015), though it wouldn't surprise me, given that the November 2013 CTP ostensibly supports them.

Furthermore, a blog post from the Visual Studio team also suggests that Visual Studio 2015 will support this feature.

Upvotes: 1

Related Questions