ist const_cast böse?
-
Konrad Rudolph schrieb:
...
T& at(size_type index) { if (not_in_range(index)) throw out_of_range_exception(); return m_data[index]; } T at(size_type index) const { return const_cast<vector*>(this)->at(index); }
Ah !!
Auf das const von Memberfunktionen war ich gar nicht gekommen.Danke,
Simon2.
-
camper schrieb:
...
Wow, danke für die Mühe. Das muss ich erstmal abarbeiten