一呼百應, "one call, a hundred responses"
Loading...
Searching...
No Matches
Collaboration diagram for Purity:

Macros

#define ein_const
 [[const]] is not const
 
#define ein_pure
 [[pure]]
 

Detailed Description

Macro Definition Documentation

◆ ein_const

#define ein_const

[[const]] is not const

Indicates the result is entirely determined by the arguments and does not access main memory in any way, including accessing members of this

This allows the compiler to easily elide/duplicate calls, because it doesn't need to consider aliasing at all when moving this function's body around.

WHEN IN DOUBT USE ein_pure, which is a much safer way to annotate pure functional code

Definition at line 84 of file common.hpp.

◆ ein_pure

#define ein_pure

[[pure]]

No side-effects other than return value, may inspect globals

Allows the compiler to easily elide/duplicate calls. This can freely commute past other operations that can be shown not to affect the memory locations read.

Definition at line 102 of file common.hpp.