// A simplistic template providing a general save-restore pattern through a // local auto/stack object (scope). // template<typename T> class AutoSaveRestore : public StackObj { public:
AutoSaveRestore(T &loc) : _loc(loc) {
_value = loc;
}
~AutoSaveRestore() {
_loc = _value;
} private:
T &_loc;
T _value;
};
// A simplistic template providing a general modify-restore pattern through a // local auto/stack object (scope). // template<typename T> class AutoModifyRestore : private AutoSaveRestore<T> { public:
AutoModifyRestore(T &loc, T value) : AutoSaveRestore<T>(loc) {
loc = value;
}
};
#endif// SHARE_UTILITIES_AUTORESTORE_HPP
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.