mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +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`.
Generics
This directory contains the collection of documents describing the generics feature of Carbon:
- Overview - A high-level description of the generics design, with pointers to other design documents that dive deeper into individual topics.
- Goals - The motivation and principles guiding the design direction.
- Terminology - A glossary establishing common terminology for describing the design.
- Detailed design - In depth description of how generic type parameters work.
Rejected alternatives- not implemented yet