[英]C++ Does Not Name A Type
I get confused when I get errors like these当我遇到这样的错误时,我会感到困惑
I have我有
FxSmartPtr<FxStreamable> able(FcNew,stream->StreamInObject());
FxGlobalPair pair(id,able);
I get an error on FxGlobalPair pair(id,able);
我在
FxGlobalPair pair(id,able);
that is able is not a type
. that is
able is not a type
。
I tried modifying to我尝试修改为
FxGlobalPair pair(id,FxSmartPtr<FxStreamable>::able);
but I get an error that is error: 'class FxSmartPtr<FxStreamable>::able' has not been declared
但我收到一个错误
error: 'class FxSmartPtr<FxStreamable>::able' has not been declared
What concept am I missing?我错过了什么概念?
UPDATE: typedef pair<FxID, FxSmartPtr<FxStreamable> > FxGlobalPair;
更新:
typedef pair<FxID, FxSmartPtr<FxStreamable> > FxGlobalPair;
UPDATE 2:更新 2:
I think that you have found the Most Vexing parse我认为您已经找到了最令人烦恼的解析
The problem is that问题是
FxSmartPtr able(FcNew,stream->StreamInObject());
FxSmartPtrable(FcNew,stream->StreamInObject());
may define a function named able, instead of a variable.可以定义一个名为able的function,而不是一个变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.