using namespace std;
using namespace ip_type;
+IP_RANGE& IP_RANGE::operator=(const IP_RANGE& other)
+{
+ IP_RANGE temp(other);
+ temp.swap(*this);
+ return *this;
+}
+
+void IP_RANGE::swap(IP_RANGE& other)
+{
+ std::swap(ip,other.ip);
+ std::swap(mask,other.mask);
+ std::swap(end,other.end);
+ std::swap(t,other.t);
+}
+
// can decode IP, IP-IP (as range) and IP/MASK (as network)
void IP_RANGE::load(const std::string& ip)
{
{ load(t,ip,mask_or_end); }
IP_RANGE(ip_type::type t, unsigned int ip, unsigned int mask_or_end=0)
{ load(t,ip,mask_or_end); }
-
+
+ IP_RANGE& operator=(const IP_RANGE& other);
+ void swap(IP_RANGE& other);
+
void load(const std::string& ip); // can decode IP-IP (as range) and IP/MASK (as network)
void load(ip_type::type t, const std::string& ip, const std::string& mask_or_end="");
void load(ip_type::type t, unsigned int ip, unsigned int mask_or_end=0);