31 Commits

Author SHA1 Message Date
georg-emg
273a859e05 added workaround for wrong value of __cplusplus in MSVC compiler (#136) 2025-01-21 10:04:12 +00:00
Bruce Mitchener
f441b29e11 Fix typo. (#154) 2025-01-21 09:47:55 +00:00
Bojan Strbac
a0ef772cbe Fix bug in unequal operator with void as expected value (#156) 2025-01-21 09:47:24 +00:00
Sy Brand
292eff8bd8 Bump version 2023-03-15 10:28:19 +00:00
Sy Brand
9d812f5e3b Fix unclosed ifdef 2023-02-15 16:37:34 +00:00
Sy Brand
5f9170aad5 Add transform_error 2023-02-15 16:32:19 +00:00
Sy Brand
1369d77100 Update expected.hpp 2023-02-15 16:17:09 +00:00
Sy Brand
ac297a9f1e Fix TL_ASSERT 2023-02-15 16:09:50 +00:00
Sy Brand
4ce32056c6 Use assert in C++14+ 2023-02-15 16:06:01 +00:00
Sy Brand
0ffb9dcebc Update expected.hpp 2023-02-15 15:59:54 +00:00
Andrew Byers
f5e6e9aeed Fixed issue #129 (#131)
+ Fixed unused variable warning
+ Added a `std::move` to avoid calling copy-assignment operator on non-copyable types

Co-authored-by: andy-byers <andrew.byers@utdallas.edu>
2023-02-15 15:54:16 +00:00
Daira Hopwood
79a2068c9a Remove undefined behaviour (#117)
* Add assertions for cases where the API documents undefined behaviour.
This affects operator->, operator*, and error() on a tl::expected
instance. The performance impact is likely negligible for typical uses.
refs #113

Signed-off-by: Daira Hopwood <daira@jacaranda.org>

* Add tests for assertions.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>

* Add documentation for assertion behaviour.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>

---------

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2023-02-15 15:53:21 +00:00
Sy Brand
11cb3fdb93 Change name 2022-11-24 19:48:55 +00:00
Sy Brand
7e842ac198 Test on many compilers (#123) 2022-11-24 19:44:29 +00:00
Sy Brand
61a4d18434 Auto-format
Fixes #65
2022-11-24 14:45:26 +00:00
Simon Truscott
2675ce3cd4 Fix warnings in test (#92)
* Convert tabs to spaces

* Remove extra semicolons in test

* Fix warnings in test

-Wreturn-type
-Wunused-parameter
-Wunused-value

* Fix -Wunused-variable warning in test

The variable 'failptr' is unused. From looking at the other variables in the
test case, it seems the fix is to first remove 'failptr' and then rename
'efail' to 'failptr'.

* Fix -Wunused-variable warning in test

* Fix -Wmacro-redefined warning in test

STATIC_REQUIRE has a previous definition in catch2/catch.hpp.
2022-11-24 13:18:39 +00:00
Simon Truscott
cd8c7920b3 Use move construction in swap implementation (#103)
* Use correct type alias in swap helper function

This was not an issue since both t_is_nothrow_move_constructible and
e_is_nothrow_move_constructible are type aliases for std::true_type.

* Use move instead of copy in swap implementation
2022-11-24 13:17:42 +00:00
Sy Brand
4e86bddee3 Add variadic constructors for tl::unexpected 2022-11-24 12:52:29 +00:00
Jackson
fb0bd6e79d Add deduction guide to tl::unexpected (#109) 2022-11-24 12:22:17 +00:00
Sy Brand
f5d8f5c462 Remove unneccesary move in emplace
Fixes #122
2022-11-24 12:01:40 +00:00
Sy Brand
d901f362cc Fix equality test for expected<void,E> 2022-11-24 11:50:20 +00:00
bobble-clank
96d547c03d Fix use of std::remove_cv in static_assert (#90)
Access result via the member type 'type'. Otherwise the static_assert does not
do as was intended.
2021-09-07 10:23:16 +01:00
Simon Brand
6fe2af5191 Move the error value when throwing an exception in .value rval overloads (#62)
* Move the error value when throwing an exception in .value rval overloads
Fixes #61

* Bump version
2019-07-10 09:26:02 +01:00
Simon Brand
d71fc68823 Update header 2019-06-25 12:33:21 +01:00
Simon Brand
888b763f4c Remove old docstrings 2019-06-25 12:31:24 +01:00
Simon Brand
66ea64f9af Merge branch 'master' into cmake_love 2019-06-25 11:19:42 +01:00
Simon Brand
4700f852c7 Merge branch 'master' into cmake_love 2019-06-25 11:15:14 +01:00
Simon Brand
7b60e7a6b2 Tidy traits 2019-06-25 10:52:35 +01:00
Simon Brand
ec5f1f18a9 Add patch to version 2019-05-01 12:17:42 +01:00
Simon Brand
4e92363167 Remove uneeded file 2019-05-01 12:16:02 +01:00
Simon Brand
90ed23a4e4 Do CMake properly 2019-05-01 12:15:40 +01:00