I am writing MyVector class which has std::vector as private field. And MyVector class should provide all the member types of std::vector. How can i solve this problem? Is a correct way to copy them like this(but it doesn't work):
class MyVector{
private:
vector<int> numbers;
public:
using value_type = vector<int>::value_type;
using size_type = vector<int>::size_type;
using iterator = vector<int>::iterator;
using allocator_type = vector<int>::allocator_type;
using difference_type = vector<int>::difference_type;
using reference = vector<int>::reference;
using const_reference = vector<int>::const_reference;
using pointer = vector<int>::pointer;
using const_pointer = vector<int>::const_pointer;
using const_iterator = vector<int>::const_iterator;
using reverse_iterator = vector<int>::reverse_iterator;
using const_reverse_iterator = vector<int>::const_reverse_iterator;
};