Skip to content
This repository was archived by the owner on Oct 7, 2026. It is now read-only.

Commit 591af89

Browse files
authored
return values for all functions in the codebase (#234)
1 parent 676aa7f commit 591af89

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎src/utils/types.hpp‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#pragma once
2+
3+
#include <optional>
4+
#include <string>
5+
#include <variant>
6+
7+
namespace ndd {
8+
9+
template <typename T = std::monostate>
10+
struct OperationResult {
11+
unsigned int code = 0;
12+
std::string message;
13+
std::optional<T> value;
14+
15+
bool ok() const { return code == 0; }
16+
};
17+
18+
} // namespace ndd

0 commit comments

Comments
 (0)