Iros
 
Loading...
Searching...
No Matches
integer.h
Go to the documentation of this file.
1#pragma once
2
5#include "di/meta/language.h"
6#include "di/types/prelude.h"
7
8namespace di::format {
9template<concepts::Integer T, concepts::Encoding Enc>
10requires(!concepts::OneOf<T, char, c32>)
13 return [=](concepts::FormatContext auto& context, T value) -> Result<void> {
14 auto width = format.width.transform(&detail::Width::value);
15 return detail::present_integer_to<Enc>(context, format.fill_and_align, format.sign, format.hash_tag,
16 format.zero, width, format.type, false, value);
17 };
18 };
19}
20
21template<concepts::Encoding Enc>
24 return [=](concepts::FormatContext auto& context, byte value) -> Result<void> {
25 auto width = format.width.transform(&detail::Width::value);
26 return detail::present_integer_to<Enc>(context, format.fill_and_align, format.sign, format.hash_tag,
27 format.zero, width, format.type, false, to_integer<u8>(value));
28 };
29 };
30}
31}
Definition format_parse_context.h:14
constexpr auto current_format_string() const -> View
Definition format_parse_context.h:191
Definition format_context.h:9
constexpr usize width
Definition gfx_test.cpp:21
constexpr auto present_integer_to(concepts::FormatContext auto &context, Optional< FillAndAlign > fill_and_align, Sign sign, HashTag hash_tag, Zero zero, Optional< size_t > width, IntegerType type, bool debug, T value) -> Result< void >
Definition base.h:436
Definition bounded_format_context.h:7
di::meta::Decay< decltype(T)> Tag
Definition tag_invoke.h:28
Expected< T, Error > Result
Definition result.h:8
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22
constexpr auto parse
Definition parse.h:23
size_t value
Definition base.h:84
Definition in_place_type.h:5