Given a string

      string input = "rgb:20/30/40";

And the following:

      ubyte r, g, b;
      auto numRead = formattedRead(dropExactly(input, 4),
"%x/%x/%x", &r, &g, &b);  // does not compile
auto numRead = formattedRead(input[4..$], "%x/%x/%x", &r, &g,
&b);            // does not compile

      string s2 = input[4..$];
      auto numRead = formattedRead(s2, "%x/%x/%x", &r, &g, &b);
// compiles

Why do the first two fail to compile but the last one does?! I
cannot see any difference between the 's2' case and the second
case, it is a completely mechanical source code transformation I
have made.

Reply via email to