İt is one of the nicest features of d. I believe it should not be used too often because it may cause longer compilation times, worse code reading, less comfort with d code scanners, editors etcetera.On 6/5/23 6:43 AM, Ferhat Kurtulmuş wrote:On Monday, 5 June 2023 at 10:01:01 UTC, John Xu wrote:[...]```d import dxml.dom; import std.stdio;DOMEntity!string xmlRoot; int main() { string xml = "<some></some>"; auto dom = parseDOM(xml);writeln(typeof(dom.children[0]).stringof); // yields "DOMEntity!string"xmlRoot = dom.children[0]; return 0; } ```In general, the easiset thing to do is use typeof, though it's not always pretty (and not always obvious how to write it). However, it's required for voldemort types.```d typeof(parseDom("")) DomEntity; ``` -Steve
Re: What's dxml DOMEntity(R) type ?
Ferhat Kurtulmuş via Digitalmars-d-learn Tue, 06 Jun 2023 09:26:02 -0700
On Tuesday, 6 June 2023 at 14:16:37 UTC, Steven Schveighoffer
wrote:
- What's dxml DOMEntity(R) type... John Xu via Digitalmars-d-learn
- Re: What's dxml DOMEntit... Ferhat Kurtulmuş via Digitalmars-d-learn
- Re: What's dxml DOME... John Xu via Digitalmars-d-learn
- Re: What's dxml DOME... Steven Schveighoffer via Digitalmars-d-learn
- Re: What's dxml ... Ferhat Kurtulmuş via Digitalmars-d-learn
- Re: What's d... Steven Schveighoffer via Digitalmars-d-learn
