Creates a bidirectional and random-access range with the single element element.
If element is passed by value the resulting range stores it internally. If element is passed by reference, the resulting range keeps only a pointer to the element.
Element type.
Element.
A range with one element.
auto singleChar = singleton('a'); assert(singleChar.length == 1); assert(singleChar.front == 'a'); singleChar.popFront(); assert(singleChar.empty);
See Implementation
Creates a bidirectional and random-access range with the single element element.
If element is passed by value the resulting range stores it internally. If element is passed by reference, the resulting range keeps only a pointer to the element.