Skip to content

Commit 9d06125

Browse files
committed
backport c++23 std::expected
After studied [0], [1] and [2], I'm inclined to backport [0] to iceberg-cpp, the main reason is that [0] has exactly the same APIs as std::expected, [1] provide some extra member functions like `map` and `map_error`, [2] has different API names like `then` and `thenOrThrow`. We want users to use iceberg::expected the same way as std::expected, and we will replace iceberg::expected with std::expected when we decide to move to c++23 some day, by backporting [0], we can facilitate a smoother transition process. We discussed about `Exceptions vs Expected` in #14, while backporting [0], I had the feeling we shouldn't choose one over the other, we can use both approaches effectively. expected provide monadic operations like `and_then`, `transform`, `or_else`, `transform_error`, let us do method chaining, which is a good sign. [0] https://github.com/zeus-cpp/expected [1] https://github.com/TartanLlama/expected [2] https://github.com/facebook/folly/blob/main/folly/Expected.h [3] https://en.cppreference.com/w/cpp/utility/expected Signed-off-by: Junwang Zhao <[email protected]>
1 parent 47f636a commit 9d06125

File tree

4 files changed

+2966
-0
lines changed

4 files changed

+2966
-0
lines changed

.github/workflows/cpp-linter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
with:
4545
style: file
4646
tidy-checks: file
47+
version: 19
4748
files-changed-only: true
4849
lines-changed-only: true
4950
thread-comments: true

0 commit comments

Comments
 (0)