为什么以下代码会出现以下错误?
为什么类型需要完整才能投入void?
struct Incomplete;
class Class
{
virtual void foo(Incomplete &incomplete)
{
(void) incomplete;
throw std::logic_error("not implemented");
}
};
Run Code Online (Sandbox Code Playgroud)
错误:
error C2027: use of undefined type 'Incomplete'
see declaration of 'Incomplete'
Run Code Online (Sandbox Code Playgroud)