Use std:: with Standard Library Components in Headers
Throughout the header (Fig. 3.9), we use
std:: when referring to
string (lines 11, 18, 24 and 37),
cout (line 33) and
endl (line 34). For subtle reasons that we’ll explain in a later chapter, headers should never contain
using directives or
using declarations (Section 2.6).