Thread overview
[Issue 19525] Duration is not usable with zero-arg std.algorithm.sum
Dec 31, 2018
perl@jani-hur.net
Jan 01, 2019
Seb
Dec 30, 2019
Dlang Bot
Jan 02, 2020
Dlang Bot
May 28, 2020
Simen Kjaeraas
May 28, 2020
Seb
May 28, 2020
Dlang Bot
May 29, 2020
Dlang Bot
December 31, 2018
https://issues.dlang.org/show_bug.cgi?id=19525

perl@jani-hur.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |perl@jani-hur.net

--
January 01, 2019
https://issues.dlang.org/show_bug.cgi?id=19525

Seb <greeenify@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |bootcamp
                 CC|                            |greeenify@gmail.com

--
December 30, 2019
https://issues.dlang.org/show_bug.cgi?id=19525

--- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> ---
@Zevenberge created dlang/phobos pull request #7339 "Improved error message when calling sum without a default value" mentioning this issue:

- Improved error message when calling sum without a default value

  If sum() is called, it tries to find a default value by constructing it with
0 (e.g. float(0)). This works for numbers, but produces obscure errors if the
value cannot be constructed this way (e.g. issue #19525). The error message now
states that the problem lies in the default value and suggests to supply one
instead.

https://github.com/dlang/phobos/pull/7339

--
January 02, 2020
https://issues.dlang.org/show_bug.cgi?id=19525

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #7339 "Improved error message when calling sum without a default value" was merged into master:

- d93e7be91db04889bc5141ccb158c54f77fd2088 by Marco de Wild:
  Improved error message when calling sum without a default value

  If sum() is called, it tries to find a default value by constructing it with
0 (e.g. float(0)). This works for numbers, but produces obscure errors if the
value cannot be constructed this way (e.g. issue #19525). The error message now
states that the problem lies in the default value and suggests to supply one
instead.

https://github.com/dlang/phobos/pull/7339

--
May 28, 2020
https://issues.dlang.org/show_bug.cgi?id=19525

Simen Kjaeraas <simen.kjaras@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
May 28, 2020
https://issues.dlang.org/show_bug.cgi?id=19525

Seb <greeenify@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #3 from Seb <greeenify@gmail.com> ---
Reopened as the issue hasn't been fixed yet. Duration should work out of the box with sum by e.g. checking whether .zero exists or specializing for the duration type.

--
May 28, 2020
https://issues.dlang.org/show_bug.cgi?id=19525

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@Biotronic created dlang/phobos pull request #7504 "Fix issue 19525 - Duration is not usable with zero-arg std.algorithm.sum" fixing this issue:

- Fix issue 19525

https://github.com/dlang/phobos/pull/7504

--
May 29, 2020
https://issues.dlang.org/show_bug.cgi?id=19525

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #7504 "Fix issue 19525 - Duration is not usable with zero-arg std.algorithm.sum" was merged into master:

- fd59b6a92e8c2a9e56db0c788f6b40f7d930aef0 by Biotronic:
  Fix issue 19525

https://github.com/dlang/phobos/pull/7504

--