================================== Versuch es einfacher zu machen ... ================================== Das notwendige technische Verständnis für Traits ist nicht zu unterschätzen. Es ist deshalb naheliegend zu überlegen, ob diese für unsere Zwecke immer notwenig sind. Hätten wir nur eine Matrix-Klasse, dann wäre das zumindest im vorigen Beispiel nicht der Fall. Eine einzige Funktion `print` wäre für Matrizen ausreichend: ==== CODE (type=cc) ============================================================ template void print(const GeMatrix &A, const char *name = "") { if (*name) { printf("%s = \n", name); } for (Index i=0; i #include struct Matrix { Matrix(long numRows, long numCols); Matrix(const Matrix &X); ~Matrix(); void operator=(const Matrix &X); const double & operator()(long i, long j) const; double & operator()(long i, long j); long numRows, numCols; double *data; }; void init(Matrix &A, long offset=1) { for (long i=0; i doc:index back -> doc:session14/page01 next -> doc:session14/page03