     
     :returns:       An array containing the products of the provided array repeated 'repeat' times
     */
+    
     mutating private func incrementLocationInPool(poolIndex: Int) {
         if poolIndex < 0 {
             return done = true

    
    :returns:   An optional element
    */
    public mutating func next() -> [T]? {
        if done {
            return nil
        }
        
        let element = map( enumerate(pools) ) {
            $1[ self.indices[$0] ]
        }
        
        self.incrementLocationInPool(self.pools.count-1)
        
        return element
    }
    

    
    :returns:   An array containing the products of the provided array repeated 'repeat' times
    */
    
    public init(_ array: [T], repeat: Int) {
        assert(repeat >= 0, "Repeat must be >= 0")
        
        self.pools = [[T]](count: repeat, repeatedValue: array)
        self.indices = [Int](count: self.pools.count, repeatedValue: 0)
        self.done = repeat <= 0 && pools.filter({$0.count == 0}).count != 0
    }
    
    
