I was reading some C++ code but couldn't figure out what line:
using unique_ptr<Node<Key, Data>>::unique_ptr;
in the following code block means:
...
using std::unique_ptr;
template <class Key, class Data>
class Node;
template <class Key, class Data>
class Tree : public unique_ptr<Node<Key, Data>>
{
using unique_ptr<Node<Key, Data>>::unique_ptr;
// Copy constructor
Tree(unique_ptr<Node<Key, Data>>&tree) {
*this = tree;
}
// Move constructor
Tree(unique_ptr<Node<Key, Data>>&& tree) :
unique_ptr<Node<Key, Data>> (move(tree)) {
}
...
}
template <class Key, class Data>
class Node {
...
}
I thought the keyword using in combination with :: was used to import an attribute or function of that class. What does the line do?
P.S.: In the Node class there are no attributes or functions that are called unique_ptr.