I have been reviewing the site's reference documentation a lot and I still can't tell when a method is global or an instance method. For example, if the foo header says it has a class called bar, and that has a public member function zop(), and that Foo module is in the standard namespace, it is not clear to me if I should be doing
1 2
#include <foo>
std::zop()
or
1 2 3
#include <foo>
Bar b;
b.zop()
Let me give you an example, basic_istream is a class template in the istream header file, and the documentation says it has a public member function called 'getline'. It is not clear to me that I am supposed to do
1 2
#include <istream>
std::getline(myinput,line);
and not
1 2
#include <istream>
myinput.getline(line);
Can somebody please explain to me how, from reading the reference documentation, I can tell if a function should be invoked on an instance, or if it should be invoked using std::?