std.range and std.algorithm Modules
A great benefit of defining our types as ranges is being able to use them not only with our own functions, but with Phobos and other libraries as well.
std.range includes a large number of range functions, structs, and classes.
std.algorithm includes many algorithms that are commonly found also in the standard libraries of other languages.
To see an example of how our types can be used with standard modules, let’s use
School with the
swapFront() swaps the front elements of two InputRange ranges.
This requires the front elements of the two ranges to be swappable. Arrays satisfy that condition.