Question about C++ SET and MAP

Revision en1, by ArepitaDePernil, 2019-01-12 02:12:57

Hello , lets say I want to overload a SET so when I use set.count() or set.find() it follows some rules, for example given a set of pairs:

1 2 3 2 4 3 ...

If it says pair A and B are equivalent if A.y < B.x or A.x > B.y , how could I overload such a function? since I tried using "==" and "<" with no success :(

Tags c++, #set, map, pair

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ArepitaDePernil 2019-01-12 02:13:31 21 Tiny change: 'pairs:\n\n1 2\n3 2\n4 3\n...\n\nIf ' -> 'pairs:\n\n{1,2} {3,4} {1,4} ...\n\nIf '
en1 English ArepitaDePernil 2019-01-12 02:12:57 350 Initial revision (published)