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

Function print

09.13-fixedString3/main.cpp:88–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87template<typename... Args>
88void print(auto fmt, const Args&... ts)
89{
90 // #1 Use the count of arguments and compare it to the size
91 // of the pack
92 static_assert(fmt.numArgs == sizeof...(Args));
93
94 // cannot pass ts... because that is run-time
95 static_assert(
96 IsMatching<std::decay_t<decltype(fmt.fmt.data[0])>,
97 Args...>(fmt.fmt.data));
98
99 printf(fmt, ts...);
100}
101
102void print(char* s, const auto&... ts)
103{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected