We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, the following code does not compile :
#include <vector> #include <fmt/core.h> int main() { std::vector<bool> myVector = {false}; fmt::print("{}", myVector[0]); }
This is because std::vector bool as a specialisation where the elements are made space efficient.
Is there something already in place that allows me to format the value or do I need to cast the element when calling fmt::print()?
https://godbolt.org/z/91P18xKxK
The text was updated successfully, but these errors were encountered:
I think this can be solved by adding a format_as overload that converts vector<bool> element type to bool. A PR is welcome.
format_as
vector<bool>
bool
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Hi, the following code does not compile :
This is because std::vector bool as a specialisation where the elements are made space efficient.
Is there something already in place that allows me to format the value or do I need to cast the element when calling fmt::print()?
https://godbolt.org/z/91P18xKxK
The text was updated successfully, but these errors were encountered: