Error while writing static function?
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.
精彩评论