The question is the same as the title, when using the extraction operator ">>" for the string
" Hello World" There are 3 leading whitespace characters, and after "Hello" there are whitespace aswell, after the word "World" its the end of the string, so my question is how does the extraction operator know if its a preceding whitespace, non-preceding whitespace and if it is the end of the string ?
How is "end of the string" represented concretely, how do we know that in a low level ?
When reading cppreference for the operator "std::basic_istream<CharT,Traits>::operator>>"
The following is shown:

Since our operand here is a basic_istream (im not sure) it corresponds to the 17th description which says "Calls func(*this), where func is an I/O manipulator." what does this mean ? How should i interpret this ?
istringstream ss(s);
string word;
while(ss>>word)
{
// do something
}
It's not really anything complicated, the basic algorithm is described on cppreference https://en.cppreference.com/w/cpp/string/basic_string/operator_ltltgtgt
A basic implementation (with no doubt plenty of bugs and missing features) would look something like this: