import std.typecons : Tuple; import dxml.dom : parseDOM; alias R1 = typeof(parseXML("<root/>").front.attributes); static assert(isAttrRange!R1); alias R2 = typeof(parseDOM("<root/>").children[0].attributes); static assert(isAttrRange!R2); alias T = Tuple!(string, "name", string, "value", TextPos, "pos"); static assert(isAttrRange!(T[])); static assert(!isAttrRange!string);
Whether the given type is a forward range of attributes.
Essentially, an attribute range must be a forward range where
Normally, an attribute range would come from EntityRange.Entity.attributes or DOMEntity.attributes, but as long as a range has the correct API, it qualifies as an attribute range.