Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatting empty std::tuple does not compile #1588

Closed
boryas opened this issue Mar 11, 2020 · 1 comment
Closed

formatting empty std::tuple does not compile #1588

boryas opened this issue Mar 11, 2020 · 1 comment

Comments

@boryas
Copy link

boryas commented Mar 11, 2020

https://godbolt.org/z/rAM82Z

I was able to work-around this for now by adding:

template <>
struct formatter<std::tuple<>> {
  template <typename ParseContext>
  constexpr auto parse(ParseContext& ctx) {
    return ctx.begin();
  }

  template <typename FormatContext>
  auto format(const std::tuple<>& tup, FormatContext& ctx) {
    return format_to(ctx.out(), "()");
  }
};
vitaut added a commit that referenced this issue Mar 14, 2020
@vitaut
Copy link
Contributor

vitaut commented Mar 14, 2020

Good catch, thanks. Fixed in 61c5a51.

@vitaut vitaut closed this as completed Mar 14, 2020
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

No branches or pull requests

2 participants