std::vector and operator==

T

Tom Smith

How does operator== work for std::vector (or in fact for any standard
container?). My guess would be that it v == w returns true iff v.size() =
w.size() and v[n]==w[n] for all valid n. Is this true? I've looked in the SGI
documentation (which was mystifying) and in TiC2 (which didn't help).

Thanks!

Tom
 
M

Mark P

Tom said:
How does operator== work for std::vector (or in fact for any standard
container?). My guess would be that it v == w returns true iff v.size()
= w.size() and v[n]==w[n] for all valid n. Is this true? I've looked in
the SGI documentation (which was mystifying) and in TiC2 (which didn't
help).

Thanks!

Tom

The SGI docs seem pretty clear to me:

http://www.sgi.com/tech/stl/ForwardContainer.html
 
T

Tom Smith

Mark said:
Tom said:
How does operator== work for std::vector (or in fact for any standard
container?). My guess would be that it v == w returns true iff
v.size() = w.size() and v[n]==w[n] for all valid n. Is this true? I've
looked in the SGI documentation (which was mystifying) and in TiC2
(which didn't help).

Thanks!

Tom

The SGI docs seem pretty clear to me:

http://www.sgi.com/tech/stl/ForwardContainer.html

Gosh, you're right. I stopped reading just before the relevant section because I
couldn't make head or tail of it - that'll teach me.

Thanks,


Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,281
Latest member
Pedroaciny

Latest Threads

Top