The Copy Trait
Types whose full value lives on the stack (integers, bool, char, shared references) can opt into Copy, making assignment duplicate the bits and leave the source usable. Copy is mutually exclusive with Drop because a bitwise duplicate must never own a resource that gets freed twice.
This Concept is waiting for its first lesson!
Types whose full value lives on the stack (integers, bool, char, shared references) can opt into Copy, making assignment duplicate the bits and leave the source usable. Copy is mutually exclusive with Drop because a bitwise duplicate must never own a resource that gets freed twice.
Are you a teacher? Sign in to start contributing.
Sign In