What is the replacement of scanf() != EOF in C++?

When the number of test cases is not mentioned , we use “while(scanf(…) != EOF)” to read until the end of input file and to identify when to terminate our program. But in C++, if we want to use cin , cout then how should we handle such cases?

while (cin >> n)