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

Function to_string

11.11-usingEnum1/main.cpp:14–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13#if __cpp_using_enum
14constexpr std::string_view to_string(Permission permission)
15{
16 switch(permission) {
17 using enum Permission; // #A New use of using
18 case Read: return "Read";
19 case Write: return "Write";
20 case Execute: return "Execute";
21 }
22
23 return "unknown";
24}
25
26int main()
27{

Callers 4

mainFunction · 0.70
mainFunction · 0.50
NormalizeFunction · 0.50
addCurrencyFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected