How can I solve: "error C2039: '{ctor}': is not a member" in Visual Studio 2005?

I am expanding the template class using C ++ in Visual Studio 2005. This gives me an error when I try to extend the base class of the template:

template <class K, class D>
class RedBlackTreeOGL : public RedBlackTree<K, D>::RedBlackTree  // Error 1
{
 public:
  RedBlackTreeOGL();
  ~RedBlackTreeOGL();

and the second error when trying to instantiate an object:

RedBlackTreeOGL<double, std::string> *tree = new RedBlackTreeOGL<double, std::string>; // error 2

Error 1:

** redblacktreeopengl.hpp (27): error C2039: '{ctor}': is not a member of 'RedBlackTree' with [K = double, D = std :: string] **

Error 2:

main.cpp (50): see the link to the compiled class template instance 'RedBlackTreeOGL' compiled

+3
source share
4 answers

, : -)

template <class K, class D>
class RedBlackTreeOGL : public RedBlackTree<K, D>
+8

OMG, ..... !

, , .

, ( SDX2000), , "" , .

:)

+2

RedBlackTree<K, D>::RedBlackTree ? ++ , (ctors).

+1

@SDX2000:

, RedBlackTree:: RedBlackTree:

template <class K, class D>
class RedBlackTree
    {
    public:
        RedBlackTree();
        // Deleting a storage object clears all remaining nodes
        ~RedBlackTree();

RedBlackTree

0

All Articles