Ich schreibe eine Matrix-Klasse für die CUDA-Verarbeitung.Warnung: Basisklasse sollte im Kopierkonstruktor explizit initialisiert werden
Ich habe eine Vektorklasse (fortan als Elements
bekannt) geschrieben und diese für die Matrixbasis verwendet. Hier
ist die Template-Definition:
template <typename T, std::size_t M, std::size_t N>
class Matrix : public Elements< Elements< T, N >, M > {
}
Es sollte beachtet werden, dass nichts dynamisch in der Elements
Klasse zugeordnet ist, noch in der Matrix
Klasse.
Ich bekomme eine warning: base class ‘struct Elements<Elements<double, 2ul>, 2ul>’ should be explicitly initialized in the copy constructor
Warnung im Kopierkonstruktor. Hier ist der Kopierkonstruktor:
DEVICE HOST
Matrix(const Matrix & that) {
for (std::size_t ind = 0; ind < M; ind++) {
for (std::size_t jnd = 0; jnd < N; jnd++) {
(*this)[ind][jnd] = that[ind][jnd];
}
}
}
Was mache ich falsch?
möglich Duplikat [Warnung: Basisklasse ‚A‘ explizit im Copykonstruktor initialisiert werden soll] (http://stackoverflow.com/questions/9098979/warning-base-class-a-should-be-explicitly-initialized-in-the-copy-constructor) – starsplusplus