QScopedValueRollback Class ReferenceThe QScopedValueRollback class resets a variable to its previous value on destruction. Далее... #include <QScopedValueRollback> This class was introduced in Qt 4.8. Открытые функции
Подробное описаниеThe QScopedValueRollback class resets a variable to its previous value on destruction. The QScopedAssignment class can be used to revert state when an exception is thrown without needing to write try-catch blocks. It can also be used to manage variables that are temporarily set, such as reentrancy guards. By using this class, the variable will be reset whether the function is exited normally, exited early by a return statement, or exited by an exception. The template can only be instantiated with a type that supports assignment. See also QScopedPointer. Описание функций-членовQScopedValueRollback::QScopedValueRollback ( T & var )Stores the previous value of var internally, for revert on destruction. QScopedValueRollback::~QScopedValueRollback ()Assigns the previous value to the managed variable. This is the value at construction time, or at the last call to commit() void QScopedValueRollback::commit ()Updates the previous value of the managed variable to its current value. |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |