I returned to one of my old C++ school assignments which implemented a binary tree. I have a file (Tree.cpp) that contains functions to insert, lookup, remove, etc nodes. At the top, I have "using namespace std;"
. The warnings I am getting are caused by another file, SymTab.hpp, that looks like this:
#ifndef SYMTAB_H
#define SYMTAB_H
#include <iostream>
#include "Tree.hpp"
using namespace std;
template <class Whatever>
class SymTab : private Tree<Whatever> {
public:
Tree<Whatever> :: Insert;
Tree<Whatever> :: Lookup;
Tree<Whatever> :: Remove;
Tree<Whatever> :: Write;
Tree<Whatever> :: Set_Debug_On;
Tree<Whatever> :: Set_Debug_Off;
};
#endif
Each of the lines after public:
give a warning like:
"SymTab.hpp:11:9: warning: access declarations are deprecated in favour of using-declarations; suggestion: add the ‘using’ keyword [-Wdeprecated] Tree :: Insert;", where "Insert is replaced with each respective function name.
Any advice on namespaces and how to get rid of these warnings?