C ++不命名A类型 [英] C++ Does Not Name A Type
问题描述
当我收到类似这样的错误时,我会感到困惑。
我有
FxSmartPtr< FxStreamable> (FcNew,stream-> StreamInObject());
FxGlobalPair对(id,able);
我在上得到一个错误FxGlobalPair对(id,able) code>,即
able不是类型
。
我尝试修改为
FxGlobalPair对(id,FxSmartPtr< FxStreamable> :: able);
但我得到的错误是错误:'class FxSmartPtr< FxStreamable> ::能力'尚未被宣布
我缺少什么概念?
> UPDATE: typedef pair< FxID,FxSmartPtr< FxStreamable> > FxGlobalPair;
UPDATE 2:
标题
我认为您已经找到大多数Vexing解析
问题是
FxSmartPtr (FcNew,stream-> StreamInObject());
可以定义一个名为able的函数,而不是一个变量。
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);
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
What concept am I missing?
UPDATE: typedef pair<FxID, FxSmartPtr<FxStreamable> > FxGlobalPair;
UPDATE 2:
Heading
I think that you have found the Most Vexing parse
The problem is that
FxSmartPtr able(FcNew,stream->StreamInObject());
may define a function named able, instead of a variable.
这篇关于C ++不命名A类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!