[Issue 11698] readf doesn't compile with bool

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 7 14:06:14 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11698



--- Comment #2 from Jerry Quinn <jlquinn at optonline.net> 2013-12-07 14:06:08 PST ---
Something like this?

Target parse(Target, Source)(ref Source s)
    if (isSomeChar!(ElementType!Source) &&
        is(Unqual!Target == bool))
{
  if (skipOver!("std.ascii.toLower(a) == b")(s, "true"))
    return true;
  if (skipOver!("std.ascii.toLower(a) == b")(s, "false"))
    return false;
  throw convError!(Source, Target)(s);
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list