10 #ifndef SRC_INCLUDE_SMASH_FPENVIRONMENT_H_
11 #define SRC_INCLUDE_SMASH_FPENVIRONMENT_H_
17 #if defined _GNU_SOURCE && !defined __clang__
35 #elif defined __SSE__ && !defined __clang__
128 template <
typename F>
Guard type that safely disables floating point traps for the scope in which it is placed.
~DisableFloatTraps()
When the guard goes out of scope the floating point environment is restored.
DisableFloatTraps(int mask=0)
Constructs the guard object.
void reenable_traps(int mask)
Reenables the given traps.
std::fenv_t environment_
The stored environment that the destructor will restore.
bool enable_float_traps(int)
Fallback that fails to set the trap.
void without_float_traps(F &&f)
Convenience function to create a scope where all floating point traps are disabled.
void setup_default_float_traps()
Setup the floating-point traps used throughout SMASH.