API: Port away from out parameters (book *ok, etc) to touples and std::tie
Open, LowPublic

Description

In our APIs we often need to return both some value and bool (or tristate) result. When we return pointer, at least in most cases we can assume nullptr means failure (but still the tristate case is not supported this way). But when value is returned we're adding bool *ok OUT parameter that's inconvenient in use.

Proposal: use tuples from C++11

It's also advertised in "No more output parameters" section of the "C++ Today" book as well. (ask @staniek for an excerpt)

staniek created this task.Oct 12 2016, 10:35 AM
staniek added projects: KDb, KReport, KProperty.
staniek updated the task description. (Show Details)Oct 12 2016, 10:42 AM
staniek added a subscriber: Kexi-Devel-list.
staniek renamed this task from Port away from out parameters (book *ok, etc) to touples and std::tie to API: Port away from out parameters (book *ok, etc) to touples and std::tie.Mar 6 2017, 8:44 AM
staniek updated the task description. (Show Details)Mar 15 2023, 8:20 PM