什么是qualified-id / name和unqualified-id / name? [英] What are qualified-id/name and unqualified-id/name?

查看:698
本文介绍了什么是qualified-id / name和unqualified-id / name?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人可以解释这些术语,因为我在许多地方遇到这些术语。我知道一些关于他们的基本理论,但不知道我知道是对还是错。



那么任何人都可以解释这些条款吗?

解决方案

一个限定名称是一种具有某种指示的属性,例如类规范,命名空间规范等。非限定名称是不合格的名称。



阅读James McNellis的答案:



什么是嵌套名称说明符?



b
$ b

  struct A {
struct B {
void F();
};
};




  • A em>,但没有 nested-name-specifier

  • A :: B > qualified-id 和 A :: 是一个嵌套名称说明符

  • :: A :: B qualified-id A :: a qualified-id ,并且 B :: A :: B :: -name-specifiers 。

  • :: A :: B :: F ,并且 B :: A :: B ::
  • I was wondering if someone could explain there terms since I encounter them in many places. I know some basic theory about them but not sure what I know is right or wrong.

    So can any one please explain these terms?

    解决方案

    A qualified name is one that has some sort of indication of where it belongs, e.g. a class specification, namespace specification, etc. An unqualified name is one that isn't qualified.

    Read James McNellis' answer here:

    What is a nested name specifier?

    Given:

    struct  A {
        struct B {
            void F();
        };
    };
    

    • A is an unqualified-id.
    • ::A is a qualified-id but has no nested-name-specifier.
    • A::B is a qualified-id and A:: is a nested-name-specifier.
    • ::A::B is a qualified-id and A:: is a nested-name-specifier.
    • A::B::F is a qualified-id and both B:: and A::B:: are nested-name-specifiers.
    • ::A::B::F is a qualified-id and both B:: and A::B:: are nested-name-specifiers.

    这篇关于什么是qualified-id / name和unqualified-id / name?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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