This is documented in
2) Extracts characters from input and appends them to str until one of the following occurs (checked in the order listed)
a) end-of-file condition on input, in which case, getline sets eofbit.
b) the next available input character is delim, as tested by Traits::eq(c, delim), in which case the delimiter character is extracted from input, but is not appended to str.
In the case of
std::getline(std::cin, str, 't');, this means
str will contain
t will be extracted and discarded, keeping
han\n in the input buffer.