MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / getOddity

Function getOddity

Examples/NoModules/Appendix A/ExA_12/ProperMath.h:11–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9enum class Oddity { Even, Odd };
10inline bool isOdd(int x) { return x % 2 != 0; }
11inline auto getOddity(int x) { return isOdd(x) ? Oddity::Odd : Oddity::Even; }
12
13#endif

Callers

nothing calls this directly

Calls 1

isOddFunction · 0.70

Tested by

no test coverage detected