#A Takes the fixed string as NTTP
| 19 | |
| 20 | template<fixed_string Str> // #A Takes the fixed string as NTTP |
| 21 | struct FormatString { |
| 22 | static constexpr auto fmt = |
| 23 | Str; // #B Store the string for easy access |
| 24 | |
| 25 | // #C Use ranges to count all the percent signs. |
| 26 | static constexpr auto numArgs = std::ranges::count(fmt.data, '%'); |
| 27 | |
| 28 | // #D For usability provide a conversion operator |
| 29 | operator const auto *() const { return fmt.data; } |
| 30 | }; |
| 31 | |
| 32 | template<fixed_string Str> |
| 33 | constexpr auto operator"" _fs() |
nothing calls this directly
no outgoing calls
no test coverage detected