首页 > 解决方案 > 没有在 C++ 项目中的任何地方定义和使用它的前向声明类背后的目的是什么?

问题描述

我正在探索著名的OBS Studio源代码。那是在https://github.com/obsproject/libdshowcapture使用一个git 子模块

在文件source/capture-filter.hpp中有一个类的前向声明,该类在整个 repo 和整个 OBS-Studio repo 中都没有定义和使用。

namespace DShow {

// some other declaration

// this class is nowhere defined and used
class CaptureSource;

//some other declaration and definitions
}

我仔细检查但没有找到任何定义或CaptureSource类的用法。如果我是对的,那么这种声明的目的是什么?

标签: c++forward-declarationobs-studio

解决方案


推荐阅读