For example,
#include
int main() {
unsigned n{};
std::cin >> n;
std::cout << n << \' \' << (bool)std::cin <
The intended semantics of your std::cin >> n
command are described here (as, apparently, std::num_get::get()
is called for this operation). There have been some semantics changes in this function, specifically w.r.t. the choice of whether to place 0 or not, in C++11 and then again in C++17.
I'm not entirely sure, but I believe these differences may account for the different behavior you're seeing.