 //  Copyright © 2016 José Massada. All rights reserved.
 //
 
-/// A fast, double-ended queue of `Element`.
+/// A fast, double-ended queue of `Element` implemented with a modified dynamic
+/// array.
 public struct CircularArray<Element> : ArrayLiteralConvertible {
   typealias Storage = CircularArrayBuffer<Element>
   

    }
  }
  
  @warn_unused_result
  public mutating func removeFirst() -> Element {
    makeMutableAndUnique()
    return storage_.removeFirst()
  }
  
  public mutating func removeFirst(count: Int) {
    makeMutableAndUnique()
    storage_.removeFirst(count)
  }
  
  @warn_unused_result
  public mutating func removeLast() -> Element {
    makeMutableAndUnique()
    return storage_.removeLast()
  }
  
  public mutating func removeLast(count: Int) {
    makeMutableAndUnique()
    storage_.removeLast(count)
  }
  
  public mutating func removeAll(keepCapacity keepCapacity: Bool = false) {
    if !isUniquelyReferencedNonObjC(&storage_) {
      let capacity = (keepCapacity) ? storage_.capacity : 0

  return lhs.elementsEqual(rhs)
}

/// Returns `true` if these circular arrays do not contain the same elements.
@warn_unused_result
public func !=<Element : Equatable>(
  lhs: CircularArray<Element>, rhs: CircularArray<Element>
