Here's some the code from the file in question, called Global.h, which is used in other header files and seems to compile just fine:
#pragma once
enum SType {null, lab, assignment, testPrep};
enum Code {none, 123, 222, 333, 432};
template<typename D>
bool validate(D task = string, D date = string) {
bool result = true;
if (task.size() < 3) {
cout << "Task too simple, please elaborate." << endl;
result = false;
}
else if (task.size() > 50) {
cout << "Task too detailed. Only 30 chars allowed." << endl;
task.empty();
result = false;
}
if (date == "02/20/93") {
date.empty();
date = "My birthday!";
}
return result;
}
As you can see I'm able to use string and ostream objects without declaring the use of a namespace or particular file. Obviously this means that Global.h is drawing the information from somewhere else, but I'm curious as to where this information is coming from? I always thought that a header file will only reconize code from other files if they've been included with the #include directive in the file itself, so I'm not sure how this is happening and am curious to know what's going on.