Commit Graph

228 Commits

Author SHA1 Message Date
Sy Brand
3f0ca7b192 Update CMakeLists.txt 2023-04-26 09:14:41 +01:00
Vratislav Podzimek
aa4f7a5e24 Add CMake artifacts to .gitignore (#139)
Otherwise they cause noise when this library is used as a git
submodule and a CMake subdirectory in a project like this:

  Changes not staged for commit:
    (use "git add <file>..." to update what will be committed)
    (use "git restore <file>..." to discard changes in working directory)
    (commit or discard the untracked or modified content in submodules)
	  modified:   vendor/expected (untracked content)

Running `cmake .` in such a project creates CMake artifacts and
then `git status` reports them "untracked content".

Signed-off-by: Vratislav Podzimek <v.podzimek@mykolab.com>
2023-03-15 10:34:03 +00:00
Sy Brand
292eff8bd8 Bump version v1.1.0 2023-03-15 10:28:19 +00:00
j-mew-s
3e304a4bdd remove submodule directory (#138) 2023-02-24 11:52:32 +00:00
Sy Brand
2a72b2f829 Delete .gitmodules 2023-02-24 09:11:23 +00:00
Sy Brand
9d812f5e3b Fix unclosed ifdef 2023-02-15 16:37:34 +00:00
Sy Brand
3a13214ff1 Test transform and transform_error 2023-02-15 16:34:53 +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
f6473697cd Don't use std::make_unique in C++11 mode 2023-02-15 16:09:14 +00:00
Sy Brand
4ce32056c6 Use assert in C++14+ 2023-02-15 16:06:01 +00:00
Sy Brand
4f4fae82a5 Update issues.cpp 2023-02-15 16:00:16 +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
b74fecd444 Update Catch version 2022-11-24 19:54:26 +00:00
Sy Brand
11cb3fdb93 Change name 2022-11-24 19:48:55 +00:00
Sy Brand
7465f4eabe Update tested versions 2022-11-24 19:48:10 +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
Sy Brand
f11bba1db5 Merge branch 'master' of github.com:TartanLlama/expected 2022-11-24 13:22:17 +00:00
Sy Brand
af47239f3f Fix issue 122 test 2022-11-24 13:22:11 +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
f88d817e06 Compile on VS2015 2022-11-24 13:11:50 +00:00
Sy Brand
9411e359b3 Merge branch 'master' of github.com:TartanLlama/expected 2022-11-24 13:11:40 +00:00
Sy Brand
e6d1f6e6bc Create cmake.yml 2022-11-24 13:07:34 +00:00
Sy Brand
d72ac6d2c9 Compile on VS 2015 2022-11-24 13:03:27 +00:00
Sy Brand
6b9843d4d2 Update .appveyor.yml 2022-11-24 13:02:29 +00:00
Sy Brand
4e86bddee3 Add variadic constructors for tl::unexpected 2022-11-24 12:52:29 +00:00
Sy Brand
4621a489bf Add tests for tl::unexpected guide 2022-11-24 12:23:11 +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
Sy Brand
68a5f5d701 Update README.md 2021-03-25 11:03:23 +00:00
Sy Brand
1d9c5d8c0d Use add_library for subdirectory usage instead of add_executable
Fixes #73
2019-11-11 10:57:18 +00:00
Isabella Muerte
0ca73ee30e 🎨 Revamp CMake to be correct and easy to understand (#69)
🎨 Cleanup include path for catch2

 Add basic .deb generation support
  WiX and RPM support is still needed (if even desired?)

⬆️ Upgrade minimum CMake version to 3.14
⬆️ Upgrade Catch to Catch v2.9.2
📌 Pin Catch to v2.9.2
2019-10-25 14:44:01 +01:00
Lesley Lai
fd96e4545c Syntax highlight in README (#64) 2019-07-18 06:45:19 +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
David Yip
bcdc78bf8e Remove internal Conan package: there is now an external one 2019-07-08 10:21:08 +01:00
Simon Brand
3d741708b9 Merge branch 'master' of github.com:TartanLlama/expected v1.0.0 2019-06-25 12:34:36 +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
4f541d7221 Cmake love (#55)
* Do CMake properly

* Remove uneeded file

* Add patch to version

* Init submodule in appveyor

* Use FetchContent

* Up CMake version requirement

* Use Xenial on Travis instead of Trusty

* Tidy traits

* Use Xenial repos
2019-06-25 11:20:05 +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
edf6f538ca Use Xenial repos 2019-06-25 10:53:05 +01:00
Simon Brand
7b60e7a6b2 Tidy traits 2019-06-25 10:52:35 +01:00