I am having issues with the following snippet of code
string const& symbol::at(int index) const {
assert(index<symbol_data.vector::size());
return symbol_data.vector::at(index);
}
Here, symbol_data is a private member of the class and is a vector
::at is a member function in the symbol class that I have defined.
When I try compiling this code, I get the following error messsage:
error: ‘template<class _Tp, class _Alloc> class std::vector’ used without template parameters
However, there is no error if I change the function prototype to
string symbol::at(int index) {...}
Does anybody know how I can get STL vectors to work properly with const references?
Your code as I’m writing this:
Instead of
symbol_data.vector::write justsymbol_data..Cheers & hth.,