Exemplo n.º 1
0
 friend range intersect(const range& a,
                        const range& b) {
     return range(std::max(a.low(), b.low()),
                  std::min(a.high(), b.high()));
 }
Exemplo n.º 2
0
 friend range unite(const range& a,
                    const range& b) {
     return range(a.low() + b.low(),
                  a.high() + b.high());
 }
Exemplo n.º 3
0
 /// \em Right-Shift range \p a by \p b indexes.
 friend range operator - (const range& a, const T& b) { return range(a.low() + b,
                                                                     a.high() + b); }
Exemplo n.º 4
0
 /// Subtract the the begin and end limits of \p a and \p b.
 friend range operator - (const range& a, const range& b) { return range(a.low() + b.low(),
                                                                         a.high() + b.high()); }
Exemplo n.º 5
0
 /// @name Saturated Addition.
 /// \{
 /// \em Right-Shift range \p b by \p a indexes.
 friend range operator + (const T& a, const range& b) { return range(a + b.low(),
                                                                     a + b.high()); }