Ich lese Scott Meyers Effective C++ 3..
In Artikel 3:In Effective C++ Punkt 3, warum Verwendung static_cast <const TextBlock- &> (* this) statt static_cast <const TextBlock-> (* this)?
Verwendung const wann immer möglich. Um konstante Elementfunktion Operator zu verwenden [], nicht konstante Elementfunktion operator [] hat 2 Guss Operationen zu tun:
const_cast<char&>( static_cast<const TextBlock&>(*this) [position] )
Warum verwendet Scott Meyers static_cast<const TextBlock&>(*this)
statt static_cast<const TextBlock>(*this)
?
... denn das kopieren würde? – Columbo
Mögliches Duplikat [Unterschied zwischen statischen \ _cast (\ * this) und statischer \ _cast (\ * this)] (http://stackoverflow.com/questions/3802556/difference-between-static-castconst-athis- und-statisch-Castconst-athis) –
anderas