Copyable

public protocol Copyable

Marker protocol for types whose values are duplicated by a plain bitwise copy of their storage.

All built-in scalars and most plain value structs conform implicitly — the compiler synthesises the conformance unless the type explicitly opts out with not Copyable. Opt out for types that own a resource (a heap allocation, a file handle) where bitwise duplication would alias the resource and break ownership.

Defined in lang/std/core/copy.ks