A simple C++ implementation of Rust Result, an alternative to Abseil Status.
This project is licensed under the terms of the MIT License.
Copyright © 2022-2024 Alfi Maulana
A simple C++ implementation of Rust Result, an alternative to Abseil Status
Home Page: https://threeal.github.io/result/
License: MIT License
A simple C++ implementation of Rust Result, an alternative to Abseil Status.
This project is licensed under the terms of the MIT License.
Copyright © 2022-2024 Alfi Maulana
This issue proposes the elimination of the step to send the test coverage report to Coveralls. The suggested change is based on the belief that sending the coverage report to Coveralls is unnecessary. Typically, it is preferable to assert if the test coverage does not reach a specific threshold, as demonstrated in the check coverage step of the C++ Starter template.
This pull request aims to merge the Result
and ResultOf<T>
structs into a single Result<T>
, where T
is defaulted to Ok
. This consolidation eliminates duplication in implementation between Result
and ResultOf<T>
and simplifies the contents of this package.
This issue proposes disabling CMake formatting, introduced through the Format.cmake package, by setting the FORMAT_SKIP_CMAKE
option to ON
. See threeal/cpp-starter#73 for the rationale behind this proposal.
This issue suggests utilizing the FixFormat.cmake module to format sample source codes in this template, replacing the currently used Format.cmake.
This issue recommends using the Gcovr Action in the test.yaml
workflow to check the test coverage and assert if the coverage doesn't meet the specified minimum percentage of lines covered.
This issue suggests modifying the build and test workflows to use the default compiler and generator instead of specifying custom ones. To set the default, one can simply remove the generator
and cxx-compiler
inputs from steps that utilize the CMake Action.
This issue suggests removing badges from the README.md
file because the information in the badges does not seem to be important to include in the readme. Refer to threeal/pipx-install-action#119 for more information and the rationale behind this proposal.
Introduce a workflow in the GitHub actions to build the documentation. This workflow includes a job that tests the successful building of the documentation.
This issue identifies this failing build on the latest master, which appears to be caused by incorrect usage of the Gcov executable when calling the Gcovr Action.
Since #87, the test workflow is no longer built using llvm, but the Gcovr Action is still utilizing the LLVM version of the Gcov executable. This mismatch has resulted in a failing build since the merging of #88.
This issue recommends reverting the Gcov executable back to using the default executable.
This issue suggests adding a RESULT_ENABLE_TESTS
option to optionally enable or disable test targets in the project. Refer to threeal/cmake-starter#76 for more information and the rationale behind this suggestion.
This issue suggests utilizing the PROJECT_IS_TOP_LEVEL
variable, replacing the CMAKE_CURRENT_SOURCE_DIR
and CMAKE_SOURCE_DIR
variables comparison. Refer to threeal/cmake-starter#66 for more information and the rationale behind this suggestion.
Modify the Result
class to store the value and error separately, enabling extraction using structured binding declaration as shown in the following example:
result::Result<Image> load_image(const std::filesystem::path& path);
int main() {
const auto [image, error] = load_image(image_path);
if (error) {
// Handle the error case.
} else {
// Do something with the image.
}
}
To prevent the result::Result
class from being discarded when it is returned from a function, add the nodiscard
attribute to the class.
This attribute will emit a warning if the return value of a function returning result::Result
is not used, reminding the user to handle the result appropriately.
The proposal is to remove the latest
branch, making the main
branch the designated latest branch.
This issue suggests eliminating the process of sending test results to Testspace in the test workflow. We are discontinuing the use of Testspace as monitoring test results is deemed unnecessary; any test failures should be evident in the CI log. Furthermore, anything merged into the main branch is considered to have passed testing.
This issue suggests utilizing version 1.0.0 of the Errors C++ Package. Some changes to the error::Error
class are needed, including changing the namespace to errors
and using errors::make
to create a new error object, among others.
This issue recommends incorporating the CheckWarning.cmake module to examine compiler warnings in the project, thus replacing the manual configuration of the CMAKE_CXX_FLAGS
variable. With the adoption of this module, it is conceivable that the check warning jobs in the test.yml
workflow may no longer be necessary, as warnings will consistently be assessed during the build process.
This issue suggests simplifying the content of the CPM.cmake
file, following the content which is implemented by Errors C++ as in threeal/errors-cpp#114.
Replace the existing usage of res::Err
with error::Error
from the Error Package in the threeal/cpp repository. This update ensures consistent usage of error handling throughout the codebase.
This issue recommends modifying the documentation hosting to utilize GitHub Pages, replacing the currently used Read the Docs platform.
GitHub Pages is preferred because we will have more control over how to setup and deploy the documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.