Halide 19.0.0
Halide compiler and libraries
|
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 |
|
inline |
Preserve the old value, then set the var to a new value.
Definition at line 391 of file Util.h.
References Halide::Internal::ScopedValue< T >::var.
|
inline |
Definition at line 395 of file Util.h.
References Halide::Internal::ScopedValue< T >::old_value, and Halide::Internal::ScopedValue< T >::var.
|
delete |
|
defaultnoexcept |
|
inline |
Definition at line 398 of file Util.h.
References Halide::Internal::ScopedValue< T >::old_value.
T& Halide::Internal::ScopedValue< T >::var |
Definition at line 384 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 385 of file Util.h.
Referenced by Halide::Internal::ScopedValue< T >::operator T(), and Halide::Internal::ScopedValue< T >::~ScopedValue().