Not quite correct here on point (2). The conflict only appears if you
include STL headers like <map> where the pair class is brought in.
There are however some issues to consider that this point brings up:
Don't reuse library identifiers for incorrect purposes. Make sure to follow
the conventions on capitalizing things to avoid this. For example, normally
your "pair" class would be called Pair.
Also, don't import the std namespace globally level. Import it only in
functions where it's necessary. NEVER import std into library functions or
header files, because it could be very confusing for people who come after
you if your code forces them to include the std namespace when they are not
expecting this behavior.
Another thing, if your code imports std, import it in a consistent manner
across all functions so that people know what to expect.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Michal
Molhanec
Sent: Tuesday, February 22, 2005 5:13 PM
To: Gabor Kalman
Cc: dev...@li...
Subject: Re: [Dev-C++] Can "class templates" be handled by Version
4.9.9.1 ?
2) the std namespace contains class pair, so because you have
> using namespace std;
at the top of the file it creates conflict. You must either rename your
class or stop using "using namespace std;"
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|