Files
sakurac/core/traits/zeroable.sakura
T

21 lines
783 B
Plaintext
Raw Normal View History

2026-10-26 10:14:11 -05:00
#! @file zeroable.sakura
#! @author John Christman (sorakatadzuma@gmail.com)
#! @copyright Malunal Studios, LLC.
#! @license MIT
#!
#! Contains the zeroable trait, which the compiler gives every type that has a
#! zero value.
module core;
#! A type with a zero value, which a variable left without a value starts at: a
#! number, `bool`, a pointer, an enum with a member of value 0, and an array,
#! struct, or union of what is, where a struct's fields with defaults start at
#! their defaults instead. A reference or a function is not, nor is what holds
#! one.
#!
#! Generic code bounded by it may write `var made: T;`, and code that only may
#! asks `if const T is zeroable` first.
#!
#! The compiler decides what is zeroable, so no type can implement it.
pub trait zeroable {}