mirror of
https://github.com/dlang/phobos.git
synced 2025-05-02 08:00:48 +03:00
![]() This is a useful technique, and non-obvious enough that other D community members were surprised when I showed it to them. The unusual formatting and code layout used here achieves the following goals: 1. Have this example appear below "Basic usage". 2. Have the overload set appear as it would at module level. 3. Have as much of the example code unit-tested as possible. Goal (2), in particular, rules out the use of a "wrapper" struct to create an overload set of static methods, which is the technique that's normally used to include an overload set in a unittest block. |
||
---|---|---|
.. | ||
dummyrange.d | ||
range.d | ||
sumtype_example_overloads.d | ||
uda.d |