MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / Dual

Function Dual

12.21-constantEvalutedAndConsteval0/main.cpp:13–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13constexpr int Dual(int i)
14{
15 if(std::is_constant_evaluated()) {
16 return CompileTime(i) + 1;
17 } else {
18 return 42;
19 }
20}
21
22#endif
23

Callers

nothing calls this directly

Calls 1

CompileTimeFunction · 0.85

Tested by

no test coverage detected