-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doxygen-awesome-css submodule and update Doxyfile
- Loading branch information
1 parent
10b5254
commit bdbaac1
Showing
4 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build | ||
docs | ||
doxygen-awesome-css | ||
.vscode | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "doxygen-awesome-css"] | ||
path = doxygen-awesome-css | ||
url = https://github.com/jothepro/doxygen-awesome-css.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
# result-cpp | ||
|
||
Result-CPP is a C++ library that provides a `Result<T, E>` type, which can be used to return and propagate errors. It's inspired by Rust's `std::Result` type. | ||
|
||
## Features | ||
|
||
- `Result<T, E>` type for returning and propagating errors. | ||
- `Ok` and `Err` static methods for creating successful and unsuccessful `Result` objects respectively. | ||
- `is_ok` and `is_err` methods for checking if the `Result` is successful or unsuccessful. | ||
- `unwrap` and `unwrap_err` methods for extracting the value or error from the `Result`. | ||
|
||
## Usage | ||
|
||
```cpp | ||
#include <iostream> | ||
#include "result.h" | ||
|
||
res::Result<int, std::string> divide(int a, int b) { | ||
if (b == 0) { | ||
return res::Result<int, std::string>::Err("Division by zero"); | ||
} else { | ||
return res::Result<int, std::string>::Ok(a / b); | ||
} | ||
} | ||
|
||
int main() { | ||
auto result = divide(10, 2); | ||
|
||
if (result.is_ok()) { | ||
std::cout << "Result: " << result.unwrap() << '\n'; | ||
} else { | ||
std::cout << "Error: " << result.unwrap_err() << '\n'; | ||
} | ||
} | ||
``` |