0

Page 432 of The C++ Programming Language, 4th ed., presents an interface for a desk calculator. It appears names like string and istream are presented "bare" (without qualification to std). Can I emulate this behavior in my own declarations, like this:

header.h

// This is header.h

#include <string>
#include <vector>

extern string s; 
void func(vector<int> vi);

// and so on

...or do names like string and vector need to be explicitly qualified?

user1505713
  • 615
  • 5
  • 20

1 Answers1

1

Page 89 of the book states

For simplicity, I will rarely use the std:: prefix explicitly in examples. Neither will I always #include the necessary headers explicitly. To compile and run the program fragments here, you must #include the appropriate headers (as listed in §4.4.5, §4.5.5, and §30.2) and make the names they declare accessible.

jkb
  • 2,376
  • 1
  • 9
  • 12