How does (std::cin >> x) or (std::cout << x) work