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

Function get

09.13-fixedString3/main.cpp:65–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64template<int I, typename CharT>
65constexpr auto get(const std::span<const CharT>& str)
66{
67 auto start = std::begin(str);
68 const auto end = std::end(str);
69
70 for(int i = 0; i <= I; ++i) { // #A Do it I-times
71 // #B Find the next percent sign
72 start = std::ranges::find(start, end, '%');
73 ++start; // #C Without this we see the same percent sign
74 }
75
76 return *start; // #D Return the format specifier character
77}
78
79template<typename CharT, typename... Ts>
80constexpr bool IsMatching(std::span<const CharT> str)

Callers

nothing calls this directly

Calls 1

beginFunction · 0.50

Tested by

no test coverage detected