Skip to content

Add support formatting std::expected<void, E> - #4148

Merged
vitaut merged 2 commits into
fmtlib:masterfrom
phprus:issue-4145
Sep 4, 2024
Merged

Add support formatting std::expected<void, E>#4148
vitaut merged 2 commits into
fmtlib:masterfrom
phprus:issue-4145

Conversation

@phprus

@phprus phprus commented Sep 3, 2024

Copy link
Copy Markdown
Contributor

Fix for issue #4145.

Requires #4151. With #4151 we can remove temporary CI commit.

Comment thread include/fmt/std.h Outdated
is_formattable<E, Char>::value>> {
struct formatter<
std::expected<T, E>, Char,
std::enable_if_t<detail::is_expected_formattable<T, Char>::value &&

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can not use:

std::is_void<T>::value || is_formattable<T, Char>::value

since is_formattable<void, Char>::value give compile-time error.

@vitaut

@vitaut vitaut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_formattable now works with void so let's remove is_expected_formattable.

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
@phprus
phprus marked this pull request as ready for review September 4, 2024 15:57
@vitaut
vitaut merged commit 22d50c1 into fmtlib:master Sep 4, 2024
@vitaut

vitaut commented Sep 4, 2024

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants