Looking to get typeof parseXML return value

Paul Backus snarwin at gmail.com
Tue Sep 7 12:46:05 UTC 2021


On Tuesday, 7 September 2021 at 05:00:50 UTC, Chris Piker wrote:
> On Tuesday, 7 September 2021 at 04:40:25 UTC, jfondren wrote:
>
>>     typeof(parseXML!simpleXML("")) xml;
>
> Hey, I like this trick!
>
> I was wondering what to use for the const(char)[] variable in 
> the typeof statement.  It's blindingly obvious in retrospect.  
> Wouldn't work so well if there wasn't a literal for the input 
> data range type.

You can always use the `.init` value of a type (in this case, 
`(const(char)[]).init`) as a dummy value for things like this.


More information about the Digitalmars-d-learn mailing list