I need to inherit all functions from std::vector
and I want to overload operators to make a complete matrix
class.
There is not too much documentation on this topic.
Matriz.h
#include <vector>
#include <iostream>
using namespace std;
template<typename T>
class Matriz:vector<T>
{
public:
using vector<T>::vector;
private:
}
Matriz.cpp
int main()
{
Matriz<int> dani;
dani.push_back(2); //Here is the error and I don`t know what it happens
}
When I want to initialize it, I got an error.
Severity Code Description Project File Line Suppression State
Error C2247 'std::vector<int,std::allocator<_Ty>>::push_back' not accessible because 'Matriz<int>' uses 'private' to inherit from 'std::vector<int,std::allocator<_Ty>>'