c++ - 具有前向声明成员时的类中的静态成员
问题描述
假设我有一个类foo
,其中声明了一个成员bar
转发。如果我想在类中使用静态函数,我需要知道的定义bar
吗?
class bar;
class foo:
{
private:
bar m_bar;
public:
static int DoStuff();
}
如果我foo::DoStuff();
通过包含使用,foo.h
我需要知道什么bar
吗?
解决方案
推荐阅读
- sql - RPAD 和 CASE 语句 - Oracle SQL - 缺少右括号错误
- python - 当我尝试构建 DataFrame 时引发值错误
- api - Azure API 管理 - 版本控制
- c# - 在 Cosmos DB 中存储具有动态属性的对象
- php - 如何获取与 symfony 验证错误相关的对象
- reactjs - 如何在 React 应用程序中执行 OAuth 以使用 Jira REST API
- javascript - 处理二维数组来计算输赢
- roku - Roku:更新 RowList 内容而不更改当前焦点项目
- c++ - 在 C++ 中为零大小的分配返回唯一地址的基本原理是什么?
- r - R 根据列号使用 if else 语句