简体   繁体   English

参考限定符的VIsual Studio 2013 C ++问题

[英]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. 我在Internet上找到了很多有关参考限定符的信息,并且我发现参考限定符对于C ++ 11是新的,并且尚未在所有编译器中实现。 But I was unable to find any information for Visual Studio 2013, and reference qualifier. 但是我找不到有关Visual Studio 2013和参考限定符的任何信息。 Can someone please help me with this matter ? 有人可以帮我解决这个问题吗? Is it reference qualifiers in Visual Studio 2013, and should i perform any additional steps? 它是Visual Studio 2013中的引用限定符,我是否应该执行任何其他步骤?

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 ';' Visual Studio 2013在以下代码上返回此错误:错误1错误C2143:语法错误:缺少';' 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. Visual Studio C ++ 11支持表明确指出,正式版本中尚未实现引用限定符。 That includes Visual Studio 2013. 其中包括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 . 我无法在发行说明中找到各种Visual Studio“ 14”和2015预览的确认信息,这些预览中提供了参考限定符(因此在即将发布的Visual Studio 2015中也是如此),尽管这并不会令我惊讶2013年11月的CTP表面上支持他们

Furthermore, a blog post from the Visual Studio team also suggests that Visual Studio 2015 will support this feature. 此外, Visual Studio团队的博客文章还建议Visual Studio 2015将支持此功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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