Filter callables by type name
import introspection.aggregate; enum item = describeAggregate!TestStructure; enum items = [ item ]; items.where.type.name.equal!"TestStructure".and.exists.should.equal(true); items.where.type.fullyQualifiedName.equal!"selectors.where.TestStructure".and.exists.should.equal(true); items.where.type.fullyQualifiedName.equal!"selectors.where.OtherStructure".and.exists.should.equal(false); items.where.type.name.isAnyOf!"TestStructure".and.exists.should.equal(true); items.where.type.fullyQualifiedName.isAnyOf!"selectors.where.TestStructure".and.exists.should.equal(true); items.where.type.fullyQualifiedName.isAnyOf!"selectors.where.OtherStructure".and.exists.should.equal(false); items.where.type.name.not.equal!"TestStructure".and.exists.should.equal(false); items.where.type.fullyQualifiedName.not.equal!"selectors.where.TestStructure".and.exists.should.equal(false); items.where.type.fullyQualifiedName.not.equal!"selectors.where.OtherStructure".and.exists.should.equal(true); items.where.type.name.not.isAnyOf!"TestStructure".and.exists.should.equal(false); items.where.type.fullyQualifiedName.not.isAnyOf!"selectors.where.TestStructure".and.exists.should.equal(false); items.where.type.fullyQualifiedName.not.isAnyOf!"selectors.where.OtherStructure".and.exists.should.equal(true);
Can iterate over filtered values
import introspection.callable; @("test") void foo() { } enum item = describeCallable!foo; enum items = [ item ]; /// iterate without index size_t index; foreach(element; items.where.any.attributes.name.equal!`"test"`) { index.should.equal(0); element.name.should.equal("foo"); index++; } index = 0; foreach(_; items.where.any.attributes.name.equal!`"other"`) { index++; } index.should.equal(0); /// iterate with index foreach(i, element; items.where.any.attributes.name.equal!`"test"`) { i.should.equal(0); element.name.should.equal("foo"); }