是否有哪个编译器支持 C++ 的哪一部分的列表?标准?

发布于 2024-11-14 18:19:48 字数 710 浏览 3 评论 0原文

我现在只是对c++的标准感到困惑,

我知道现在有三个版本:c++98、c++03和c++0x;

据说VC6是在C++标准化之前编写的,所以我不介意它不支持标准,但是,我发现vs2010甚至不能支持C++03,这是代码:

class A
{
    class B { };
    friend class X;
};

class X
{
    A::B mx;
    class Y : A::B
    {
        A::B my;// This should be wrong in C++98 and C++03
                // But it works in VS2010
    };
};

编译后失败了,我想也许vs2010支持c++0x,所以我将代码更改为:

class A
{
    class B { };
    friend class X;
};

class X : A::B // This should be right in c++0x, but it is an error in vs2010
{
    A::B mx;
    class Y : A::B
    {
        A::B my;
    };
};

所以这让我很困惑,我在这里问:vs2010支持哪个版本的c++标准,如果它不完全支持标准,是否有一个列表告诉我哪个编译器支持哪个标准?

I'm just confused about c++'s standards right now,

I know there is three versions right now: c++98, c++03 and c++0x;

It is said that VC6 was wrote before C++ was standardized, so I don't mind if it does not support the standards, BUT, I found that vs2010 can't even support C++03, here is the code:

class A
{
    class B { };
    friend class X;
};

class X
{
    A::B mx;
    class Y : A::B
    {
        A::B my;// This should be wrong in C++98 and C++03
                // But it works in VS2010
    };
};

after the compile fails, I think maybe vs2010 supports c++0x, so I changed the code to:

class A
{
    class B { };
    friend class X;
};

class X : A::B // This should be right in c++0x, but it is an error in vs2010
{
    A::B mx;
    class Y : A::B
    {
        A::B my;
    };
};

So this made me very confused, and I'm here asking: which version of c++ standard is vs2010 supporting, if it does not totally supporting the standard, is there a list of which tells me which complier supports which standard?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人间不值得 2024-11-21 18:19:48

看来您对 MS VC++ 版本特别感兴趣...请参阅 http:// msdn.microsoft.com/en-us/library/x84h5b78.aspx - 更改“其他版本”下拉组合框中的版本号以查看各个版本。

It seems you're specifically interested in MS VC++ versions... see http://msdn.microsoft.com/en-us/library/x84h5b78.aspx - vary the version number in the "Other Versions" drop-down combobox to see the various releases.

月亮坠入山谷 2024-11-21 18:19:48

C++98 不再作为标准存在。它被 C++03 取代。其次,由于C++11推出的时间安排,VS2010支持C++03和C++11之间的一种折中方案。

不仅如此,每项实施都存在缺陷。您认为它不支持 C++03 是因为它没有 export 吗?

C++98 does not exist as a Standard anymore. It was superseded by C++03. Secondly, because of the way that C++11 coming out was timed, VS2010 supports a kind of half-way-house between C++03 and C++11.

More than that, every implementation has warts. Do you think that it doesn't support C++03 because it doesn't have export?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文