## std.clone: Interfaces for explicitly Clonable types. ## This module is imported by default. ## The Clone interface. Any type implementing Clone is cloneable. ## Data structures built with pointers and references are pretty much ## the only things that are *not* implicitly clonable. pub type Clone = interface clone(lent Self): Self # todo ## Generic implementation of `clone` for structs. pub func clone[T: struct](self: T): T = ... ## Generic implementation of `clone` for tuples. pub func clone[T: tuple](self: T): T = ... ## Implementation of `clone` for arrays of any size. pub func clone[T, S: static[uint]](self: array[T, S]): array[T, S] = ... ## Implementation of `clone` for lists. pub func clone[T](self: list[T]): list[T] = ... ## Implementation of `clone` for strings. pub func clone(self: str): str = ...