Changeset 3450


Ignore:
Timestamp:
Dec 7, 2015, 7:39:01 AM (6 years ago)
Author:
Peter
Message:

closes #849

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Segment.h

    r3449 r3450  
    9494    //Segment& operator=(const Segment&);
    9595  };
     96
     97
     98  /**
     99     \brief Inequality operator
     100
     101     Inequality operator is defined via the operator< of T or in the
     102     general case Compare.
     103
     104     \return true if Compare returns true for either when comparing
     105     lhs.begin() and rhs.begin() or when comparing lhs.end() and
     106     rhs.end().
     107
     108     \since New in yat 0.14
     109  */
     110  template<typename T, class Compare>
     111  bool operator!=(const Segment<T, Compare>& lhs,
     112                  const Segment<T, Compare>& rhs)
     113  {
     114    Compare comp;
     115    return comp(lhs.begin(), rhs.begin()) ||  comp(rhs.begin(), lhs.begin())
     116      || comp(lhs.end(), rhs.end()) || comp(rhs.end(), lhs.end());
     117  }
     118
     119
     120  /**
     121     \return true if Compare returns false when comparing lhs.begin()
     122     and rhs.begin() as well as when comparing lhs.end() and
     123     rhs.end().
     124
     125     \since New in yat 0.14
     126  */
     127  template<typename T, class Compare>
     128  bool operator==(const Segment<T, Compare>& lhs,
     129                  const Segment<T, Compare>& rhs)
     130  {
     131    return !(lhs!=rhs);
     132  }
     133
    96134
    97135  /**
Note: See TracChangeset for help on using the changeset viewer.