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

fix: update to_string_view function for fmt 11.1 #3301

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

chenrui333
Copy link
Contributor

update to_string_view function for fmt 11.1

/tmp/spdlog-20241225-25576-12pt7n/spdlog-1.15.0/include/spdlog/common.h:369:54: error: no template named 'basic_format_string' in namespace 'fmt'; did you mean 'basic_format_arg'?
  369 | inline fmt::basic_string_view<Tasic_sfmt::basic_string_view<T> to_string_view(fmt::basic_format_string<T, Args...> fmt) {
      |                                                 ~~~~~^~~~~~~~~~~~~~~~~~~
      |                                                      basic_format_arg
/opt/homebrew/include/fmt/base.h:2428:35: note: 'basic_format_arg' declared here
 2428 | template <typename Context> class basic_format_arg {
      |                                   ^

relates to Homebrew/homebrew-core#202442

Signed-off-by: Rui Chen <rui@chenrui.dev>
@heitbaum
Copy link

Tested - working 👍

@tt4g
Copy link
Contributor

tt4g commented Dec 26, 2024

Related #3258, #3202 (PR #3277)

@gabime gabime merged commit 276ee5f into gabime:v1.x Dec 26, 2024
16 checks passed
@gabime
Copy link
Owner

gabime commented Dec 26, 2024

Thanks @chenrui333

@fasiondog
Copy link

👍🏻 waiting for new release ...

@jdrouhard
Copy link

The new code for fmt >= 11.1.0 in this PR is dead...no reason to have a to_string_view(basic_format_arg<>) since that's never used.

The new fmt::format_string<> in fmt 11.1.0 implicitly converts to spdlog::string_view_t which already has a to_string_view() overload.

@gabime
Copy link
Owner

gabime commented Jan 2, 2025

@chenrui333 Not sure i understand. It clearly fixed the problem with 11.1.0

@jdrouhard
Copy link

@chenrui333 Not sure i understand. It clearly fixed the problem with 11.1.0

It's dead code. You can just make it a #ifndef and remove the to_string_view(fmt::basic_format_arg<>()...) overload. The new overload isn't used.

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.

6 participants