Helper class for saving/restoring variable values on the stack, to allow for early-exit that preserves correctness. More...
#include <Util.h>
Public Member Functions | |
ScopedValue (T &var) | |
Preserve the old value, restored at dtor time. | |
ScopedValue (T &var, T new_value) | |
Preserve the old value, then set the var to a new value. | |
~ScopedValue () | |
operator T () const | |
ScopedValue (const ScopedValue &that)=delete | |
ScopedValue (ScopedValue &&that) noexcept=default | |
Public Attributes | |
T & | var |
T | old_value |
Helper class for saving/restoring variable values on the stack, to allow for early-exit that preserves correctness.
|
inline |
Preserve the old value, restored at dtor time.
Definition at line 387 of file Util.h.
References old_value, and var.
Referenced by ScopedValue(), and ScopedValue().
|
inline |
|
inline |
|
delete |
References ScopedValue().
|
defaultnoexcept |
References ScopedValue().
|
inline |
T& Halide::Internal::ScopedValue< T >::var |
Definition at line 384 of file Util.h.
Referenced by ScopedValue(), ScopedValue(), and ~ScopedValue().
T Halide::Internal::ScopedValue< T >::old_value |
Definition at line 385 of file Util.h.
Referenced by operator T(), ScopedValue(), ScopedValue(), and ~ScopedValue().