mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
This PR makes it so that types can implement the `IndexWith` interface so that they can provide their custom indexing behavior. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
10 lines
370 B
Plaintext
10 lines
370 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
package Core library "prelude/operators/index";
|
|
|
|
interface IndexWith(SubscriptType:! type, ElementType:! type) {
|
|
fn At[self: Self](subscript: SubscriptType) -> ElementType;
|
|
}
|