stl set

Andreas Pfeil andreas.pfeil@anu.edu.au
Fri May 19 01:38:00 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It does so by comparing twice:
if a is not smaller b and b is not smaller a, then obviously they have
to be equal with respect to this comparison function.

Andreas

Aseem Rastogi wrote:
> Hi,
> 
> I am a bit confused about STL sets. STL set takes a comparator function
> as input which returns true if first argument is less than second
> argument, false otherwise. How does this detect equal elements ?
> 
> For eg. set<int> will not allow one int to be inserted twice. How does
> it check for equality when comparator function doesn't provide that info ?
> 
> I tries to go through set code in stl_set.h but couldn;t get anything.
> 
> Thanks in advance.
> 
> Regards,
> Aseem.
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEbSGKmz2azRoltLYRAl/oAJ4+Dv12Liy+5N2eukHBH1IjUOKywACfUiMB
3ZV7Ckeb3Oryy2Ge+sxxIA0=
=dZQo
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3929 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20060519/4ed22961/attachment-0001.bin>


More information about the Gcc-help mailing list