Skip to content

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

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

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

Conversation

@phprus
Copy link
Copy Markdown
Contributor

@phprus phprus commented Sep 3, 2024

Fix for issue #4145.

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

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

Copy link
Copy Markdown
Contributor

@vitaut vitaut left a comment

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
Copy link
Copy Markdown
Contributor

vitaut commented Sep 4, 2024

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