@@ -295,27 +295,27 @@ Performs `nothrow` and `@nogc` string to native type conversion.
295295
296296Rseturns: true if success and false otherwise.
297297+/
298- bool fromString (T, C)(scope const (C)[] str, ref T value)
299- if (isSomeChar! C)
298+ bool fromString (T, C)(scope const (C)[] str, ref T value) @trusted
299+ if (isSomeChar! C && isFloatingPoint ! T )
300300{
301- static if (isFloatingPoint! T)
302- {
303- import mir.bignum.decimal: Decimal, DecimalExponentKey;
304- import mir.utility: _expect;
301+ import mir.bignum.decimal: Decimal, DecimalExponentKey;
302+ import mir.utility: _expect;
305303
306- Decimal! 128 decimal = void ;
307- DecimalExponentKey key;
308- auto ret = decimal.fromStringImpl(str, key);
309- if (_expect(ret, true ))
310- {
311- value = cast (T) decimal;
312- }
313- return ret;
314- }
315- else
304+ Decimal! 128 decimal = void ;
305+ DecimalExponentKey key;
306+ auto ret = decimal.fromStringImpl(str, key);
307+ if (_expect(ret, true ))
316308 {
317- return parse ! T(str, value) && str.length == 0 ;
309+ value = cast (T) decimal ;
318310 }
311+ return ret;
312+ }
313+
314+ // / ditto
315+ bool fromString (T, C)(scope const (C)[] str, ref T value)
316+ if (isSomeChar! C && ! isFloatingPoint! T)
317+ {
318+ return parse! T(str, value) && str.length == 0 ;
319319}
320320
321321// /
0 commit comments