MCPcopy Create free account
hub / github.com/Extra-Creativity/Modern-Cpp-Basics / checkFormatTo

Function checkFormatTo

08-String & Stream/code/Profile.cpp:103–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103static void checkFormatTo(int num)
104{
105 for (int idx = 0; idx < num; ++idx)
106 {
107 int i = 42;
108 double d = 7.7;
109 char buf[100] = { '?', '?', '?', '?', '?', '?', '?',
110 '?', '?', '?', '?', '?', '?' };
111 auto ret = std::format_to_n(buf, 99, "{} {}", i, d);
112 *(ret.out) = '\0';
113 if (num == 1)
114 {
115 std::cout << buf << '\n';
116 return;
117 }
118 }
119}
120
121template<typename T>
122void measure(std::string s, T func)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected