Parses a QVariant from str.
A list of registered symbols for units and prefixes.
The numeric type of the quantities.
a function that takes a reference to any kind of string and returns the parsed number.
// From http://en.wikipedia.org/wiki/List_of_humorous_units_of_measurement import std.conv : parse; auto century = unit!real("T"); alias LectureLength = typeof(century); auto symbolList = SymbolList!real().addUnit("Cy", century).addPrefix("µ", 1e-6L); alias numberParser = (ref s) => parse!real(s); auto parser = Parser!(real, numberParser)(symbolList); auto timing = 1e-6L * century; assert(timing == parser.parse("1 µCy"));
A quantity parser.