Visual Studio2005でC++を使用してテンプレートクラスを拡張しています。次のコマンドを使用してテンプレート基本クラスを拡張しようとすると、エラーが発生します。
template <class K, class D>
class RedBlackTreeOGL : public RedBlackTree<K, D>::RedBlackTree // Error 1
{
public:
RedBlackTreeOGL();
~RedBlackTreeOGL();
オブジェクトをインスタンス化しようとすると、2番目のエラーが発生します。
RedBlackTreeOGL<double, std::string> *tree = new RedBlackTreeOGL<double, std::string>; // error 2
エラー1:
** redblacktreeopengl.hpp(27):エラーC2039:'{ctor}':[K = double、D = std::string]の'RedBlackTree'のメンバーではありません**
エラー2:
main.cpp(50):コンパイル中のクラステンプレートインスタンス化'RedBlackTreeOGL'への参照を参照してください