// Copyright (c) 2020, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.utils;

import java.util.function.Consumer;

public interface ForEachable<T> {

  void forEach(Consumer<T> consumer);

  default void forEachWithIndex(IntObjConsumer<T> consumer) {
    IntBox index = new IntBox();
    forEach(element -> consumer.accept(index.getAndIncrement(), element));
  }
}
