This simple code:
#include <print>
int main()
{
volatile int i = 5;
std::println("{}", i);
}
Doesn't compile with any major implementation of the std library. Any particular reason why it doesn't have a formatter? Or is it just an omission?
Sample error:
error: static assertion failed due to requirement 'is_default_constructible_v<std::formatter<volatile int, char>>': std::formatter must be specialized for the type of each format arg
volatile? So the question is, why does that make a difference, is it required by the standard or just left unspecified, and perhaps also what other modifiers might cause it to not compile?