mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-26 01:31:10 +00:00
17 lines
532 B
Plaintext
17 lines
532 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/destroy";
|
|
|
|
// Object destruction, including running `fn destroy()`. Note this is distinct
|
|
// from memory deallocation.
|
|
interface Destroy {
|
|
fn Op[addr self: Self*]();
|
|
}
|
|
|
|
// Provide a default blanket impl for trivial destruction.
|
|
impl forall [T:! type] T as Destroy {
|
|
fn Op[addr self: Self*]() = "no_op";
|
|
}
|