The OpenD Programming Language

SortedRange.release

Releases the controlled range and returns it.

This does the opposite of assumeSorted: instead of turning a range into a SortedRange, it extracts the original range back out of the SortedRange using move.std.algorithm.mutation..

struct SortedRange(Range, alias pred = "a < b", SortedRangeOptions opt = SortedRangeOptions.assumeSorted)
return scope
release
()
if ()

Examples

import std.algorithm.sorting : sort;
int[3] data = [ 1, 2, 3 ];
auto a = assumeSorted(data[]);
assert(a == sort!"a < b"(data[]));
int[] p = a.release();
assert(p == [ 1, 2, 3 ]);

Meta