参考限定符的VIsual Studio 2013 C ++问题 [英] VIsual Studio 2013 C++ problems with reference qualifiers

查看:57
本文介绍了参考限定符的VIsual Studio 2013 C ++问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Internet上找到了很多有关参考限定符的信息,并且我发现参考限定符是C ++ 11的新增功能,尚未在所有编译器中实现。但是我找不到有关Visual Studio 2013和参考限定符的任何信息。有人可以帮我解决这个问题吗?它是Visual Studio 2013中的引用限定符,我是否应该执行任何其他步骤?

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?

我还具有以下代码:

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

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

Visual Studio 2013在以下代码上返回此错误:
错误1错误C2143:语法错误:'&'之前缺少';'

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?

在此先感谢您的回答。

推荐答案

Visual Studio C ++ 11支持表明确指出,正式版本中尚未实施参考限定词。其中包括Visual Studio 2013。

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.

我无法在发行说明中找到有关各种Visual Studio 14和2015预览的确认信息,这些参考中有限定词预览(并因此在即将面世的Visual Studio 2015中),但考虑到 2013年11月的CTP表面上支持它们

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团队的博客文章还建议Visual Studio 2015将支持此功能。

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

这篇关于参考限定符的VIsual Studio 2013 C ++问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆