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

Only use typeid() in std.h when it is available #3468

Merged
merged 2 commits into from
May 31, 2023
Merged

Conversation

danakj
Copy link
Contributor

@danakj danakj commented May 31, 2023

This allows the std.h formatters to work when RTTI is disabed.

For issue #3464

@danakj
Copy link
Contributor Author

danakj commented May 31, 2023

https://github.com/chromium/subspace/actions/runs/5127988704/ demonstrates this PR at work with RTTI disabled

include/fmt/core.h Outdated Show resolved Hide resolved
@danakj danakj force-pushed the master branch 2 times, most recently from 4441347 to e27be85 Compare May 31, 2023 02:16
Copy link
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.

Thanks for the PR! Mostly looks good but please address inline comments.

include/fmt/core.h Outdated Show resolved Hide resolved
include/fmt/core.h Show resolved Hide resolved
include/fmt/std.h Outdated Show resolved Hide resolved
On MSVC it is always available, otherwise it depends on whether
RTTI is enabled.
The condition is constexpr, so the compiler warns if a runtime check
is used as there's no need to generate code for it.
@vitaut vitaut merged commit 35547d6 into fmtlib:master May 31, 2023
40 checks passed
@vitaut
Copy link
Contributor

vitaut commented May 31, 2023

Thank you!

@danakj
Copy link
Contributor Author

danakj commented May 31, 2023

Thank you as well :)

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.

None yet

3 participants