class の宣言内で、Density
これらのメンバー関数を作成しました。
class Density {
public:
template <typename Container>
void printStream (Container<Point>::iterator lo, Container<Point>::iterator hi);
......
};
cpp ファイルで:
template <typename Container>
void Density::printStream (Container<Point>::iterator lo, Container<Point>::iterator hi)
{
...
}
ただし、コンパイルしようとすると次のエラーが発生します。
src/../include/density.hpp:166:23: error: 'Container' is not a template
src/../include/density.hpp:166:50: error: expected unqualified-id before 'lo'
src/../include/density.hpp:166:50: error: expected ')' before 'lo'
src/../include/density.hpp:166:50: error: expected initializer before 'lo'
src/density.cpp: In member function 'void Density::startAlgorithm()':
src/density.cpp:291:43: error: 'printStream' was not declared in this scope
src/density.cpp: At global scope:
src/density.cpp:327:28: error: 'Container' is not a template
src/density.cpp:327:55: error: expected unqualified-id before 'lo'
src/density.cpp:327:55: error: expected ')' before 'lo'
src/density.cpp:327:55: error: expected initializer before 'lo'
何を変更すればよいですか?また、なぜ、この問題を理解したいのでしょうか。