diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/kstd/include/kstd/bits/format/formatter/byte.hpp | 23 | ||||
| -rw-r--r-- | libs/kstd/include/kstd/format | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/libs/kstd/include/kstd/bits/format/formatter/byte.hpp b/libs/kstd/include/kstd/bits/format/formatter/byte.hpp new file mode 100644 index 0000000..70d98f4 --- /dev/null +++ b/libs/kstd/include/kstd/bits/format/formatter/byte.hpp @@ -0,0 +1,23 @@ +#ifndef KSTD_BITS_FORMAT_FORMATTER_BYTE_HPP +#define KSTD_BITS_FORMAT_FORMATTER_BYTE_HPP + +#include "../context.hpp" +#include "../formatter.hpp" +#include "integral.hpp" + +#include <cstddef> + +namespace kstd +{ + + template<> + struct formatter<std::byte> : formatter<int> + { + auto format(std::byte value, format_context & context) const -> void + { + formatter<int>::format(static_cast<int>(value), context); + } + }; + +} // namespace kstd +#endif
\ No newline at end of file diff --git a/libs/kstd/include/kstd/format b/libs/kstd/include/kstd/format index 946ed69..adee5f8 100644 --- a/libs/kstd/include/kstd/format +++ b/libs/kstd/include/kstd/format @@ -6,6 +6,7 @@ #include "bits/format/context.hpp" // IWYU pragma: export #include "bits/format/formatter.hpp" // IWYU pragma: export #include "bits/format/formatter/bool.hpp" // IWYU pragma: export +#include "bits/format/formatter/byte.hpp" // IWYU pragma: export #include "bits/format/formatter/cstring.hpp" // IWYU pragma: export #include "bits/format/formatter/integral.hpp" // IWYU pragma: export #include "bits/format/formatter/ordering.hpp" // IWYU pragma: export |
