enum century = unit!(real, "century"); alias LectureLength = typeof(century); enum symbolList = SymbolList!real() .addUnit("Cy", century) .addPrefix("µ", 1e-6L); alias ctParser = compileTimeParser!(real, symbolList, std.conv.parse!(real, string)); enum timing = 1e-6L * century; static assert(timing == ctParser!"1 µCy");
Creates a compile-time parser that parses a string for a quantity and automatically deduces the quantity type.