I have made a simple Matrix class with a std::vector as the underlying container.
My problem is when i use the copy constructor on the Matrix class, the std::vector does not get copied.

My matrix.h:

```
#ifndef MATRIX_H
#define MATRIX_H

#include <vector>
#include <iostream>

template <typename T>
class Matrix
{
private:
    int m_rows;
    int m_cols;
    std::vector<T> m_vector;

public:
    // Constructor
    Matrix(int rows, int cols)
        : m_rows{ rows }, m_cols{ cols }
    { 
        m_vector.reserve(rows * cols);
        std::cout << "Constructor. vector capacity = " << m_vector.capacity() << '\n'; 
    }

    // Copy constructor
    Matrix(const Matrix<T>& old)
        : m_rows{ old.m_rows }, m_cols{ old.m_cols }
    {
         m_vector.reserve(old.m_rows * old.m_cols);
         m_vector = old.m_vector;
        std::cout << "Copy constructor. vector capacity = " << m_vector.capacity() << '\n';
    }

    const T& operator()(int row, int col) const
    {
        return m_vector[row * m_cols + col];
    }

    T& operator()(int row, int col)
    {
        return m_vector[row * m_cols + col];
    }
}

```

My test of the class in main.cpp is then:

```
#include "matrix.h"

int main()
{
    // Create new matrix and fill
    Matrix<int> matrix(3, 3);

    int count = 0;

    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            matrix(i, j) = count++;
        }
    }

    // Print new matrix
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            std::cout << matrix(i, j) << ' ';
        }
        std::cout << '\n';
    }
    std::cout << '\n';

    // Copy assignment and print new
    Matrix<int> matrix2(matrix);

    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            std::cout << matrix2(i, j) << ' ';
        }
        std::cout << '\n';
    }
    std::cout << '\n';

    return 0;
}

```

I was expecting this to print identical matrices of ints 0-8.
This is the output:

```
Constructor. vector capacity = 9
0 1 2 
3 4 5 
6 7 8 

Copy constructor. vector capacity = 9
0 0 0 
0 0 0 
0 0 0 

```

I seems that the copying in the copy constructor doesn't copy the std::vector properly