ocean.util.DeepReset

Utility to recursively reset fields of struct to their .init value while preserving array pointers (their length is set to 0 but memory is kept available for further reusage)

Members

Functions

ClassDeepReset
void ClassDeepReset(T dst)

Deep reset function for dynamic class instances.

DynamicArrayDeepReset
void DynamicArrayDeepReset(T[] dst)

Deep reset function for dynamic arrays. To reset a dynamic array set the length to 0.

StaticArrayDeepReset
void StaticArrayDeepReset(T[] dst)

Deep reset function for static arrays. To reset a static array go through the whole array and set the items to the init values for the type of the array.

StructDeepReset
void StructDeepReset(T dst)

Deep reset function for structs.

Templates

DeepReset
template DeepReset(T)

Template to determine the correct DeepReset function to call dependent on the type given.

Meta

License

Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. Alternatively, this file may be distributed under the terms of the Tango 3-Clause BSD License (see LICENSE_BSD.txt for details).