简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM