wreport::options::LocalOverride< T, T1 > Struct Template Reference

Temporarily override a variable while this object is in scope. More...

`#include <options.h>`

## Public Member Functions

| LocalOverride (T &param, T1 new_value)

## Data Fields

T | old_value
T & | param

## Detailed Description

template<typename T, typename T1 = T>
struct wreport::options::LocalOverride< T, T1 >

Temporarily override a variable while this object is in scope.

Note that if the variable is global, then the override is temporally limited to the scope, but it is seen by all the functions that reference the variable functions.

Example:

{
auto o = options::local_override(options::var_silent_domain_errors, true);
var.setd(value)
}
wreport::options::var_silent_domain_errors
bool var_silent_domain_errors
Whether domain errors on Var assignments raise exceptions.

The documentation for this struct was generated from the following file:

- options.h