News for hackers. Stuff that matters.
Re:C++ audio mixing library design by planede on Monday October 17, 2022 @04:47AM (#33231148)
std::span is new enough to not be in muscle memory of C++ programmers.

Even the standard library commits a similar sin with `from_chars` and not taking a `string_view`.

Re:C++ audio mixing library design by gpderetta on Monday October 17, 2022 @07:54AM (#33232323)
std::span is new, but I have seen some custom form of it in pretty much every codebase I've worked with for a very long time (and implemented some myself). Like it used be the case for std::string in older codebases.
Re:C++ audio mixing library design by pencilguin on Monday October 17, 2022 @01:50PM (#33237271)
string_view would definitely have been wrong.

std::span did not exist in the Standard at the time std::from_chars was adopted.

An overload that takes std::span would be easy, and harmless. But as std::from_chars is only ever used from within some other abstraction, any benefit would be minimal.

Re:C++ audio mixing library design by planede on Thursday October 20, 2022 @11:28AM (#33276217)
Why would string_view be wrong there?
Re:C++ audio mixing library design by pencilguin on Thursday October 20, 2022 @04:09PM (#33280029)
Because, then, to parse out a number you would first need to get it into a string.