`examplevalues` property
HaraldZealot via Digitalmars-d
digitalmars-d at puremagic.com
Mon Aug 3 05:13:13 PDT 2015
I found myself in situation that were good that all types support
`.examplevalues` property in unittest version. This property will
return array of predefined values for specified type (we can even
have some convention like `examplevalues[0]` is `init`,
`examplevalues[1]` is `min` (for numerical type) an so on). If
custom types doesn't redefine this property the array consist
only from `init`.
The use case for this: templated struct or class with
container-like semantics and internal unittest for method of such
class.
Thoughts?
More information about the Digitalmars-d
mailing list