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

do not put fmt::formatter into fmt namespace #24

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

tchaikov
Copy link
Contributor

as fmt::formatter already has the namespace qualifier. otherwise, the build would fail when building with fmt 11, like:

/usr/include/boxed-cpp/boxed.hpp:218:8: error: extra qualification not allowed [-fpermissive]
  218 | struct fmt::formatter<boxed::detail::boxed<Type, Tag>>
      |        ^~~
In file included from /usr/include/fmt/format.h:41,
                 from /usr/include/boxed-cpp/boxed.hpp:211:
/usr/include/fmt/base.h: In instantiation of ‘static void fmt::v11::detail::value<Context>::format_custom_arg(void*, typename Context::parse_context_type&, Context&) [with T = boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>; Formatter = fmt::v11::formatter<boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>, char, void>; Context = fmt::v11::context; typename Context::parse_context_type = fmt::v11::basic_format_parse_context<char>]’:
/usr/include/fmt/base.h:1373:19:   required from ‘constexpr fmt::v11::detail::value<Context>::value(T&) [with T = boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>; Context = fmt::v11::context]’
 1373 |     custom.format = format_custom_arg<
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
 1374 |         value_type, typename Context::template formatter_type<value_type>>;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/base.h:1631:41:   required from ‘constexpr fmt::v11::detail::format_arg_store<Context, NUM_ARGS, 0, DESC> fmt::v11::make_format_args(T& ...) [with Context = context; T = {boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>, boxed::detail::boxed<unsigned int, vtpty::detail::tags::Height>}; long unsigned int NUM_ARGS = 2; long unsigned int NUM_NAMED_ARGS = 0; long long unsigned int DESC = 255; typename std::enable_if<(NUM_NAMED_ARGS == 0), int>::type <anonymous> = 0]’
 1631 |   return {arg_mapper<Context>().map(val)};
      |                                         ^

tchaikov added 2 commits July 14, 2024 11:54
as fmt::formatter already has the namespace qualifier. otherwise,
the build would fail when building with fmt 11, like:

```
/usr/include/boxed-cpp/boxed.hpp:218:8: error: extra qualification not allowed [-fpermissive]
  218 | struct fmt::formatter<boxed::detail::boxed<Type, Tag>>
      |        ^~~
In file included from /usr/include/fmt/format.h:41,
                 from /usr/include/boxed-cpp/boxed.hpp:211:
/usr/include/fmt/base.h: In instantiation of ‘static void fmt::v11::detail::value<Context>::format_custom_arg(void*, typename Context::parse_context_type&, Context&) [with T = boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>; Formatter = fmt::v11::formatter<boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>, char, void>; Context = fmt::v11::context; typename Context::parse_context_type = fmt::v11::basic_format_parse_context<char>]’:
/usr/include/fmt/base.h:1373:19:   required from ‘constexpr fmt::v11::detail::value<Context>::value(T&) [with T = boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>; Context = fmt::v11::context]’
 1373 |     custom.format = format_custom_arg<
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
 1374 |         value_type, typename Context::template formatter_type<value_type>>;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/base.h:1631:41:   required from ‘constexpr fmt::v11::detail::format_arg_store<Context, NUM_ARGS, 0, DESC> fmt::v11::make_format_args(T& ...) [with Context = context; T = {boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>, boxed::detail::boxed<unsigned int, vtpty::detail::tags::Height>}; long unsigned int NUM_ARGS = 2; long unsigned int NUM_NAMED_ARGS = 0; long long unsigned int DESC = 255; typename std::enable_if<(NUM_NAMED_ARGS == 0), int>::type <anonymous> = 0]’
 1631 |   return {arg_mapper<Context>().map(val)};
      |                                         ^
```

Signed-off-by: Kefu Chai <[email protected]>
otherwise the tree fails to build:

```
/usr/include/fmt/base.h:1392:29: error: passing ‘const fmt::v11::formatter<boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>, char, void>’ as ‘this’ argument discards qualifiers [-fpermissive]
 1392 |     ctx.advance_to(cf.format(*static_cast<qualified_type*>(arg), ctx));
      |                    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boxed-cpp/boxed.hpp:219:10: note:   in call to ‘auto fmt::v11::formatter<boxed::detail::boxed<T, Tag> >::format(const boxed::detail::boxed<T, Tag>&, fmt::v11::format_context&) [with Type = unsigned int; Tag = vtpty::detail::tags::Width; fmt::v11::format_context = fmt::v11::context]’
  219 |     auto format(boxed::detail::boxed<Type, Tag> const& val, fmt::format_context& ctx)
      |          ^~~~~~
```

Signed-off-by: Kefu Chai <[email protected]>
Copy link
Member

@Yaraslaut Yaraslaut left a comment

Choose a reason for hiding this comment

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

Many thanks @tchaikov

@Yaraslaut Yaraslaut merged commit 6bb4da2 into contour-terminal:master Jul 17, 2024
6 checks passed
@tchaikov tchaikov deleted the extraneous-fmt branch July 17, 2024 10:13
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