// GID - GID friend gid_type operator- (gid_type const& lhs, gid_type const& rhs) { boost::uint64_t lsb = lhs.id_lsb_ - rhs.id_lsb_; boost::uint64_t msb = lhs.id_msb_ - rhs.id_msb_; if (lsb > lhs.id_lsb_) --msb; return gid_type(msb, lsb); }
// GID + GID friend gid_type operator+ (gid_type const& lhs, gid_type const& rhs) { boost::uint64_t lsb = lhs.id_lsb_ + rhs.id_lsb_; boost::uint64_t msb = lhs.id_msb_ + rhs.id_msb_; if (lsb < lhs.id_lsb_ || lsb < rhs.id_lsb_) ++msb; return gid_type(msb, lsb); }
friend gid_type operator& (gid_type const& lhs, std::uint64_t rhs) { return gid_type(lhs.id_msb_, lhs.id_lsb_ & rhs); }
// GID - std::uint64_t friend gid_type operator- (gid_type const& lhs, std::uint64_t rhs) { return lhs - gid_type(0, rhs); }
// GID + boost::uint64_t friend gid_type operator+ (gid_type const& lhs, boost::uint64_t rhs) { return lhs + gid_type(0, rhs); }