Bug 39 - Add Ipv4Address operator <
Add Ipv4Address operator <
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: network
pre-release
PC Linux
: P1 blocker
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-19 11:44 UTC by Gustavo J. A. M. Carneiro
Modified: 2007-06-19 12:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2007-06-19 11:44:36 UTC
Any objections about adding this?

namespace ns3 {
  bool operator < (Ipv4Address const &addrA, Ipv4Address const &addrB) {
    return (addrA.GetHostOrder () < addrB.GetHostOrder ());
  }
}

I discovered I needed it in order to store Ipv4Addresses in a std::set.
Comment 1 Mathieu Lacage 2007-06-19 11:47:39 UTC
I have to confess that I hate it but I see the use-case.

Please, commit.
Comment 2 Gustavo J. A. M. Carneiro 2007-06-19 12:00:55 UTC
Committed as rev 784.