I'm reading a C++ file. There is some structure I don't understand in C++, but I don't know how to google to learn this. Here is a piece of code that i'm reading :
template <typename value_type>
class iterstack: private vector<value_type> {
private:
using vector<value_type>::crbegin;
using vector<value_type>::crend;
using vector<value_type>::push_back;
using vector<value_type>::pop_back;
using vector<value_type>::back;
typedef typename vector<value_type>::const_reverse_iterator
const_iterator;
public:
using vector<value_type>::clear;
using vector<value_type>::empty;
using vector<value_type>::size;
const_iterator begin() { return crbegin(); }
const_iterator end() { return crend(); }
void push (const value_type& value) { push_back (value); }
void pop() { pop_back(); }
const value_type& top() const { return back(); }
};
In above code, theresomething I don't understand.
Firstly :
class iterstack: private vector<value_type>
what is the difference above line with class iterstack: vector<value_type>
(without private
keyword)
Secondly :
using vector<value_type>::crbegin;
I'm really don't understand this line. using
keyword, I often use under this form : using namespace std
Another way of using makes me confusing.
Please tell me the meaning of two points above.
Thanks :)