News for hackers. Stuff that matters.
Re:Const all the things? by BoorishBears on Monday January 24, 2022 @10:41AM (#30058983)

    auto [error, value] = do_something()
    if(!error)
         process(value)
Is there something wrong with this?
Re:Const all the things? by kaashif on Monday January 24, 2022 @01:12PM (#30061501)
Hmm, is it error, value or value, error? In this situation, I'd prefer something like std::optional or std::variant, which you can't get wrong as easily as swapping two variables in a structured bind.

Those have their problems too, though, and I'd never claim std::variant is "nice" to use.