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

formatted_size misses locale overload #3084

Closed
gerboengels opened this issue Sep 6, 2022 · 1 comment
Closed

formatted_size misses locale overload #3084

gerboengels opened this issue Sep 6, 2022 · 1 comment

Comments

@gerboengels
Copy link
Contributor

formatted_size doesn't have an overload which takes a locale (overloads 3 and 4 on cpp reference).

Godbolt link (using MSVC to compare with its std implementation, which does support this overload): https://godbolt.org/z/94dsPhTMb

@vitaut
Copy link
Contributor

vitaut commented Sep 7, 2022

It's just a matter of adding an overload similar to

fmt/include/fmt/core.h

Lines 3284 to 3291 in 1feb430

template <typename... T>
FMT_NODISCARD FMT_INLINE auto formatted_size(format_string<T...> fmt,
T&&... args) -> size_t {
auto buf = detail::counting_buffer<>();
detail::vformat_to(buf, string_view(fmt),
format_args(fmt::make_format_args(args...)), {});
return buf.count();
}

but taking and forwarding the locale. This overload should be added here:

A PR is welcome.

gerboengels pushed a commit to gerboengels/fmt that referenced this issue Sep 7, 2022
vitaut pushed a commit that referenced this issue Sep 7, 2022
Co-authored-by: Gerbo Engels <gerbo.engels@ortec-finance.com>
@vitaut vitaut closed this as completed Sep 7, 2022
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