HDK
|
#include <scoped.h>
Public Member Functions | |
template<typename T > | |
TfScopedAutoVar (T &x, const T &val) | |
Reset variable on exiting scope.
A TfScopedAutoVar
sets a variable to a value when created then restores its original value when destroyed.
For example:
This differs from TfScopedVar
in that it's not a template class, the value type is deduced automatically and it allocates memory on the heap. If performance is critical or memory must not be allocated then use TfScopedVar
instead.