简体   繁体   中英

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); 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM