Struct SetFactory

This struct serves only a range-based interface for convenient construction of Sets implemented on an explicitly supplied base type.

struct SetFactory(T) ;

Constructors

NameDescription
this

Methods

NameDescription
opIndex
opSlice

Inner structs

NameDescription
Transfer

Example

auto s0 = SetFactory!byte[1, 4..7, 10];

enum Count {One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten}
auto s1 = SetFactory!Count[Count.Three, Count.Six .. Count.Nine];

auto s2 = SetFactory!char['a'..'z'];
assert('b' in s2);
assert('A' !in s2);

with (Count) {
    auto s3 = SetFactory!Count[Six, Two .. Four];
    assert(Two in s3);
    assert(Three in s3);
    assert(Four in s3);
    assert(Six in s3);
}

auto s5 = SetFactory!char[];    // Empty set.
assert(s5.card() == 0);