title: Code repetitiveness when writing custom extensions
body: <p>I pretty often encounter situation like this:</p>
  <pre><code> public extension CountableRange {
       func advanced(by n: Bound.Stride) -&gt; Self {
          let lowerBound = self.lowerBound.advanced(by: n)
          let upperBound = self.upperBound.advanced(by: n)
          return .init(uncheckedBounds: (lowerBound, upperBound))
      }
      
      static func + (lhs: Self, rhs: Bound.Stride) -&gt; Self {
          lhs.advanced(by: rhs)
      }
      
      static func - (lhs: Self, rhs: Bound.Stride) -&gt; Self {
          lhs.advanced(by: -rhs)
      }
  }
  
  //--------------------------------------------------------
  
  public extension CountableClosedRange {
      func advanced(by n: Bound.Stride) -&gt; Self {
          let lowerBound = self.lowerBound.advanced(by: n)
          let upperBound = self.upperBound.advanced(by: n)
          return .init(uncheckedBounds: (lowerBound, upperBound))
      }
      
      static func + (lhs: Self, rhs: Bound.Stride) -&gt; Self {
          lhs.advanced(by: rhs)
      }
      
      static func - (lhs: Self, rhs: Bound.Stride) -&gt; Self {
          lhs.advanced(by: -rhs)
      }
  }
  </code></pre>
  <p>Absolutely identical two pieces of code. Is there any way to deal with it?<br />
  If <code>CountableRange</code> and <code>CountableClosedRange</code> have conformed to some common protocol <code>BasicRange</code> I could just write one extension for that <code>BasicRange</code> protocol. But often it's not the case.</p>