Skip to content

Instantly share code, notes, and snippets.

@lironsade
Created September 11, 2017 16:30
Show Gist options
  • Save lironsade/b8ae192d2f12bcbb5d5d9cbfa3f65b5b to your computer and use it in GitHub Desktop.
Save lironsade/b8ae192d2f12bcbb5d5d9cbfa3f65b5b to your computer and use it in GitHub Desktop.
//
// Created by liron on 9/11/17.
//
#ifndef EX3_MATRIX_HPP
#define EX3_MATRIX_HPP
#include <vector>
template <class T>
class Matrix
{
public:
Matrix();
Matrix(std::size_t rows, std::size_t cols, const std::vector<T>& cells);
Matrix(const Matrix<T> &other);
Matrix(Matrix<T>&& other);
private:
std::vector<T> _matrix;
std::size_t _rows;
std::size_t _cols;
};
template <typename T>
Matrix::Matrix() : _matrix{0} {}
template <typename T>
Matrix::Matrix(std::size_t rows, std::size_t cols, const std::vector<T> &cells) : _matrix(rows * cols), _rows{rows}, _cols{cols}
{
}
Matrix::Matrix(const Matrix &other)
{
}
Matrix::Matrix(Matrix &&other)
{
}
#endif //EX3_MATRIX_HPP
int main()
{
Matrix<int> a{};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment