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

Function Normalize

04.01-includeHell0/main.cpp:20–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19template<class T>
20inline decltype(auto) Normalize(const T& arg)
21{
22 // Handle bools first, we like their string representation.
23 if constexpr(std::is_same_v<std::remove_cvref_t<T>, bool>) {
24 return details::ConvertToBoolString(arg);
25
26 } else if constexpr(std::is_integral_v<T>) {
27 return std::to_string(arg);
28
29 } else {
30 return (arg);
31 }
32}
33
34# endif /* STRCAT_H */
35

Callers 3

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 2

ConvertToBoolStringFunction · 0.85
to_stringFunction · 0.50

Tested by

no test coverage detected