Article View: comp.std.c++
Article #3985Re: STL's operators template<>bool operator<(...) hurt!!!!!!!!!
From: David Vandevoorde
Date: Wed, 10 Apr 1996 21:10
Date: Wed, 10 Apr 1996 21:10
44 lines
2352 bytes
2352 bytes
>>>>> "OP" == O Petrova <opetrova@blue.weeg.uiowa.edu> writes:
[...]
OP> class EExpression
OP> {
OP> public:
OP> EExpression( int );
OP> EExpression( double );
OP> public:
OP> friend EExpression operator+(const EExpression&, const EExpression&);
OP> friend EExpression operator<(const EExpression&, const EExpression&);
OP> .....
OP> public:
OP> string fSQLString;
OP> };
OP> void main()
OP> {
OP> // Works fine w/o STL, doesn't with it
OP> // because of template<class T> bool operator> in function.h
OP> // ^^^^
OP> EExpression a = EExpression( 2 ) > 4;
OP> ....
OP> }
OP> I don't like that at all. I think that those operators should be
OP> removed form STL.
Your prayers have been heard... almost ;^)
The relational operator templates of the standard library have been moved
to their own subnamespace (::std::rel_ops, I believe --- not sure). This
is the only case of a standard sub-::std namespace (no pun intended :).
This makes it easy to avoid the problem above (if you have a sufficiently
close implementation that is).
Daveed
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID:
<xsohguru87h.fsf@avs.cs.rpi.edu>Path:
arc1-ca.pugleaf.net!fido.asd.sgi.com!austernReferences:
<9604072103.AA09560@avs.cs.rpi.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern From: vandevod@cs.rpi.edu (David Vandevoorde) Newsgroups: comp.std.c++ Subject: Re: STL's operators template<>bool operator<(...) hurt!!!!!!!!! Date: 10 Apr 1996 14:10:10 PDT Organization: RPI Computer Science Approved: austern@isolde.mti.sgi.com Message-ID: <xsohguru87h.fsf@avs.cs.rpi.edu> References: <9604072103.AA09560@avs.cs.rpi.edu> NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: 10 Apr 1996 16:37:06 -0400 In-Reply-To: opetrova@blue.weeg.uiowa.edu's message of 08 Apr 1996 10:15:32 PDT X-Newsreader: Gnus v5.1 X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMWwjs0y4NqrwXLNJAQE9cgIAoxAIqycxyXpnGKapuBmaPI9cvvAFUAgK glQuqodDjSzosLt5bUKx0o2vVlpxr2/kGdK2G1pmx47O3ZN5K4kSgg== =SeJs Originator: austern@isolde.mti.sgi.com