gul-cpp / gul14

General Utility Library for C++14
https://gul14.info/
GNU Lesser General Public License v2.1
2 stars 1 forks source link

Add gul14::expected as a backport of std::expected from C++23 #38

Closed alt-graph closed 1 year ago

alt-graph commented 1 year ago

This adds an implementation of the expected class template, (roughly) as standardized in C++23. The implementation is by Sy Brandt: https://github.com/TartanLlama/expected

I made some small adjustments like removing lots of #ifdefs that are not relevant if we assume a C++14 compiler. Also, I made the bad_expected_access exception class template more compliant to what the standard (or at least cppreference) says it should look like.

This also bumps the GUL14 version to 2.8.0 – at least I think so. Do we have any handling for the "patch" number that we introduced with 2.7.1?

Closes #27.

Finii commented 1 year ago

This also bumps the GUL14 version to 2.8.0 – at least I think so. Do we have any handling for the "patch" number that we introduced with 2.7.1?

Well, the API version is stored as meson project_version (what you changed). Patch-releases (i.e. 2.8.1 instead of 2.8.0) should be bugfixes and have the same API version 2.8.

The version from the git tags is checked against that API version. The git version can consist of 3 numbers and get addidtional automatic numbers for inter-release builds.

Doxygen uses only the API version.

So this looks good, after adding the correct tags. Github changes the commit hashes if you merge via web interface. If you merge via command line the git tags you assigned beforehand will still be valid.

alt-graph commented 1 year ago

Rebased on main. Still needs a review to be merged. :)

alt-graph commented 1 year ago
* https://github.com/gul-cpp/gul14/blob/main/debian/copyright.in needs to be expanded I guess

* It is not documented which version you add. Maybe add to the commit message

  * Original repo link
  * Version of that repo's release that we actually added

Good points, thank you! I have added the CC0 license to copyright.in and added the link to the original Github repo and version information to expected.h itself and to the first commit message.