Commit graph

4 commits

Author SHA1 Message Date
Bernie Innocenti
cecebbbacc Convert system/core to Result::ok()
No functionality changes, this is a mechanical cleanup.

Test: m
Test: cd system/core && atest
Change-Id: Ifdaa3ce1947ed578f656d5a446978726eb416c36
2020-02-06 17:04:27 +00:00
Bernie Innocenti
1cc76dfe84 Delete dangerous comparison operators from base::expected
These operators were included because they're present in the draft
standard proposal of std::expected, but they were deemed to lead to
bugs, particularly when T is implicitly convertible to bool.

Change-Id: Ib149decf1f230198f358dc1ae0eaed71961363f6
Test: m
2020-02-04 12:55:23 +00:00
Jiyong Park
b2a85c4333 Add expected<void,E>
Result<void> could be used instead of Result<Success>.

Bug: 132145659
Test: libbase_test
Change-Id: I7f079a94d06c5ecb8b0303ced981f0995253dc40
2019-06-07 08:10:32 +09:00
Jiyong Park
7d89fb164b Add android::base::expected
android::base::expected is an Android implementation of the
std::expected proposal.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0323r7.html

For usage, refer to the expected.h header file and
expected_test.cpp

Bug: 132145659
Test: libbase_test

Change-Id: I65d3a1ecf8654d9858989755dfd0065c81f7b209
2019-05-22 06:39:27 +09:00