You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C++20 comes with a handy is_constant_evaluated which can be used to detect evaluation context.
Essentially, it can allow gcem to be a complete wrapper around stdlib operations (where stdlib is being replaced for compile-time context) and better runtime performance.
Moreover, without depending on C++ version, __cpp_lib_is_constant_evaluated can be used to check if the compiler provides the function (from header <type_traits>)
C++20 comes with a handy
is_constant_evaluated
which can be used to detect evaluation context.Essentially, it can allow gcem to be a complete wrapper around stdlib operations (where stdlib is being replaced for compile-time context) and better runtime performance.
Moreover, without depending on C++ version,
__cpp_lib_is_constant_evaluated
can be used to check if the compiler provides the function (from header<type_traits>
)Before:
After:
Benefits:
Cons: Slight more code
The text was updated successfully, but these errors were encountered: