| 45 | |
| 46 | template<typename T> |
| 47 | constexpr static bool match(const char c) |
| 48 | { |
| 49 | switch(c) { // #B Our specifier to type mapping table |
| 50 | case 'd': return plain_same_v<int, T>; |
| 51 | case 'c': return plain_same_v<char, T>; |
| 52 | case 'f': return plain_same_v<double, T>; |
| 53 | case 's': // #C Character strings are a bit more difficult |
| 54 | return (plain_same_v<char, |
| 55 | std::remove_all_extents_t<T>> and |
| 56 | std::is_array_v<T>) or |
| 57 | (plain_same_v<char*, |
| 58 | std::remove_all_extents_t<T>> and |
| 59 | std::is_pointer_v<T>); |
| 60 | default: return false; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | template<int I, typename CharT> |
| 65 | constexpr auto get(const std::span<const CharT>& str) |
nothing calls this directly
no outgoing calls
no test coverage detected