Created
September 11, 2017 16:30
-
-
Save lironsade/b8ae192d2f12bcbb5d5d9cbfa3f65b5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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