Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/boost-ext/ut
/ do_not_optimize
Function
do_not_optimize
example/benchmark.cpp:39–41 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
37
#if defined(__GNUC__) or defined(__clang__)
38
template <class T>
39
void do_not_optimize(T&& t) {
40
asm volatile(
""
::
"m"
(t) :
"memory"
);
41
}
42
#else
43
#pragma optimize(
""
, off)
44
template <class T>
Callers
1
main
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected