Halide
|
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. More... | |
ScopedValue (T &var, T new_value) | |
Preserve the old value, then set the var to a new value. More... | |
~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 |
|
inline |
Preserve the old value, then set the var to a new value.
Definition at line 371 of file Util.h.
References Halide::Internal::ScopedValue< T >::var.
|
inline |
Definition at line 375 of file Util.h.
References Halide::Internal::ScopedValue< T >::old_value, and Halide::Internal::ScopedValue< T >::var.
|
delete |
|
defaultnoexcept |
|
inline |
Definition at line 378 of file Util.h.
References Halide::Internal::ScopedValue< T >::old_value.
T& Halide::Internal::ScopedValue< T >::var |
Definition at line 364 of file Util.h.
Referenced by Halide::Internal::ScopedValue< T >::ScopedValue(), and Halide::Internal::ScopedValue< T >::~ScopedValue().
T Halide::Internal::ScopedValue< T >::old_value |
Definition at line 365 of file Util.h.
Referenced by Halide::Internal::ScopedValue< T >::operator T(), and Halide::Internal::ScopedValue< T >::~ScopedValue().