Why the Rectangle<int> bias for Rectangle<->String conversion?


#1
{
    const Rectangle<double> a (100.0346000001, 100.0346000001, 100.0346000001, 100.0346000001);

    const String s = a.toString();

    const Rectangle<double> b (Rectangle<double>::fromString (s));

    jassert (a == b);
}

The jassert in the example above is triggered with the current implementation. Why has the string conversion been restricted to integers? I guess it could be a bit weird converting a stringified Rectangle<double> to a Rectangle<int>.

I noticed afterwards the "The string should contain 4 integer tokens" documentation in Rectangle::fromString, but I'd like to suggest adding a similar warning label to Rectangle::toString().


#2

Originally that class was non-templated.. I guess it was just never extended to parse floating point numbers. Would take a bit of template hackery to do that without slowing down the integer version.