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

Class Format

10.16-logFunction2/main.cpp:11–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9enum LogLevel { Info, Warning, Error };
10
11struct Format {
12 std::string_view fmt;
13 std::source_location loc;
14
15 // #A Constructor allowing implicit conversion
16 Format(
17 const char* _fmt,
18 std::source_location _loc = std::source_location::current())
19 : fmt{_fmt}
20 , loc{_loc}
21 {}
22};
23
24// #B Log now takes Format which implicitly adds source location
25// information

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected