"#include" in .h or .cpp
I've read this doggone passage (at the bottom of page 395 and top of 396) over and over but somehow it ain't registering.
"First, add the '#include' directive for the 'utility' header to Box.h and then add the following 'using' directives:
<Code snipped out>
This makes the names of the templates for the comparison operators in the 'std::rel_ops" namespace available. You should never add a 'using namespace' to a header file so the only alternative to the declarations above would be to define the comparison operator functions yourself."
It seems to be saying "do this" and then "but that's not a good idea", yet page 398 says"
... the class definition in 'Box.h' will look something like this:
#pragma once
#include <utility> // For operator overload templates
using namespace std::rel_ops;
class CBox
{
...
Would any of my fellow pilgrims offer a bit of insight here before I find myself bouncing off the walls in a padded room?
Regards,
Aza D. Oberman
|