开发者

Error while writing static function?

开发者 https://www.devze.com 2023-02-14 20:43 出处:网络
Error while writing static function. static int function_name ( const Reference< data_type>* ptr) { }

Error while writing static function. static int function_name ( const Reference< data_type>* ptr) { }

when i wrote a static functin which takes Reference pointer then ir gives me following error error: ISO C++ forbids declaration o开发者_JS百科f 'Reference' with no type error: expected ',' or '...' before '<' token


The compiler is complaining because it doesn't know what a Reference<T> is. Either you've forgotten to #include the header file that it is defined in, or you've forgotten to forward-declare it.


You presumably mean Reference to be a template but the compiler doesn't see it as one.

0

精彩评论

暂无评论...
验证码 换一张
取 消