3 ms·
printf() is likewise just a function. If we're not calling out std::format("{}{}",oops); as nonsense then we'd have no right to complain about printf("%s%d",oop
by tialaramex 5y ago
printf() is likewise just a function. If we're not calling out std::format("{}{}",oops); as nonsense then we'd have no right to complain about printf("%s%d",oops) either. I say it is nonsense because it isn't sense.
- kllrnohj 5y agoOf course we can complain. First, std::format is already improved, so this is moot anyway. But more importantly, std::format always caught the error & threw a well defined exception. printf() does no such thing. It has no validation that your inputs matched the format spec. std::format always had that. So does std::cout & iostreams, for that matter.