I basically want to test if stdin has input (like if you echo and pipe it). I have found solutions that work, but they are ugly, and I like my solutions to be clean.
Would this not work?
std::cin.rdbuf()->in_avail();