Accumulator factory: Difference between revisions

Content added Content deleted
(Added comment.)
(Added comment.)
Line 2,153: Line 2,153:


=== Fixed accumulator type ===
=== Fixed accumulator type ===
Argument to the factory function nay be any signed integer, unsigned integer or float.
Argument to accumulator function must be of the same type.
Result of the accumulator function is also of the same type.
<lang Nim>
<lang Nim>
proc accumulator[T: SomeNumber](x: T): auto =
proc accumulator[T: SomeNumber](x: T): auto =