prog.cpp:12:26: error: invalid abstract return type for member function ‘virtual MatrixInterface MatrixInterface::doSomethingElse() const’
virtual MatrixInterface doSomethingElse() const = 0;
^
prog.cpp:5:7: note: because the following virtual functions are pure within ‘MatrixInterface’:
class MatrixInterface
^
prog.cpp:10:15: note: virtual void MatrixInterface::doSomething() const
virtual void doSomething() const = 0;
^
prog.cpp:12:26: note: virtual MatrixInterface MatrixInterface::doSomethingElse() const
virtual MatrixInterface doSomethingElse() const = 0;
^
prog.cpp: In instantiation of ‘class MatrixA<3, 4>’:
prog.cpp:49:49: required from here
prog.cpp:23:22: error: invalid covariant return type for ‘MatrixA<rows, cols> MatrixA<rows, cols>::doSomethingElse() const [with int rows = 3; int cols = 4]’
MatrixA<rows, cols> doSomethingElse() const override
^
prog.cpp:12:26: error: overriding ‘virtual MatrixInterface MatrixInterface::doSomethingElse() const’
virtual MatrixInterface doSomethingElse() const = 0;
^
prog.cpp: In function ‘int main()’:
prog.cpp:50:49: error: cannot allocate an object of abstract type ‘MatrixB<5, 6>’
matricies.push_back(VectorType::value_type(new MatrixB<5, 6>));
^
prog.cpp:29:35: note: because the following virtual functions are pure within ‘MatrixB<5, 6>’:
template<int rows, int cols>class MatrixB : public MatrixInterface
^
prog.cpp:12:26: note: virtual MatrixInterface MatrixInterface::doSomethingElse() const
virtual MatrixInterface doSomethingElse() const = 0;
^
prog.cpp:51:49: error: cannot allocate an object of abstract type ‘MatrixC<7, 8>’
matricies.push_back(VectorType::value_type(new MatrixC<7, 8>));
^
prog.cpp:37:35: note: because the following virtual functions are pure within ‘MatrixC<7, 8>’:
template<int rows, int cols>class MatrixC : public MatrixInterface
^
prog.cpp:12:26: note: virtual MatrixInterface MatrixInterface::doSomethingElse() const
virtual MatrixInterface doSomethingElse() const = 0;
^