gpt4 book ai didi

c++ - 成员函数的正式定义

转载 作者:太空狗 更新时间:2023-10-29 23:51:05 24 4
gpt4 key购买 nike

我正在阅读 N3797 工作草案,我想知道成员函数 的定义是什么(即成员函数是什么意思)。我目前的理解是成员函数是在类或命名空间范围内声明的函数。但是成员函数的实际定义是什么?

我想弄清楚 member function 单词组合必须如何解释?它是类或命名空间的成员函数还是其他东西的成员函数?

例如:第 12 条命名为特殊成员函数

它在哪里解释成标准?

最佳答案

它在 §9.3/1 中有详细说明。

Functions declared in the definition of a class, excluding those declared with a friend specifier (11.3), are called member functions of that class. A member function may be declared static in which case it is a static member function of its class (9.4); otherwise it is a non-static member function of its class (9.3.1, 9.3.2).

关于c++ - 成员函数的正式定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24083865/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com