mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:30:14 +01:00
Iterators, smart pointers, optional, and expected types depend on `operator*`. This commit adds `CppUnsafeDeref` as a core interface, with an associated function, so that the compiler can dereference user-defined C++ types. Things not implemented in this commit: * `operator*` overload resolution * SemIR lowering --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
12 lines
431 B
Plaintext
12 lines
431 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/deref";
|
|
|
|
// TODO: Align with https://docs.carbon-lang.dev/docs/design/values.html#dereferencing-customization.
|
|
interface CppUnsafeDeref {
|
|
let Result:! type;
|
|
fn Op[self: Self]() -> ref Result;
|
|
}
|