I have the following code:
#include <print>
#include <vector>
int main() {
std::vector<int> v{1, 2, 3};
std::println("{}", v);
}
Among the numerous errors this produces, there is (clang++ -std=c++23 -stdlib=libc++
, https://godbolt.org/z/3z9Tseh37):
[...]/format_arg_store.h:167:17: error: static assertion failed due to [...]
167 | static_assert(__arg != __arg_t::__none, "the supplied type is not formattable");
| ^~~~~~~~~~~~~~~~~~~~~~~~
This confuses me because according to the cppreference C++23 compiler support page, libc++ support std::println
and implements P2286: Formatting Ranges.
Am I doing something wrong or is this a standard library bug?
Am I doing something wrong or is this a standard library bug?
Formatting ranges are specified to be supported in <format>
, but the standard does not specify that <print>
must include <format>
. (So just include <format>
to make the code well-formed).
However, from a user-friendly perspective, including <print>
should support formatting ranges.
There is already an open issue about this, see 71925.