mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Add a way for classes to add custom destructor code:
```
class Class1 {
// forward declaration
destructor [me: Self] { ... }
}
// out-of-line definition
destructor Class1 [me: Self] { ... }
class Class2 {
// can modify `me` as part of destruction
destructor [addr me: Self*] { ... }
}
base class MyBaseClass {
virtual destructor [addr me: Self*] { ... }
}
class MyDerivedClass extend MyBaseClass {
impl destructor [addr me: Self*] { ... }
}
```
and constraints `Concrete`, `Deletable`, `Destructible`, and `TrivialDestructor`.
Docs
This directory contains current, accepted documentation underpinning Carbon. These documents cover all aspects of Carbon ranging from the project down to detailed designs for specific language features.
If you're trying to learn more about Carbon, we recommend starting at /README.md.