Make error code types nodiscard

This commit is contained in:
2025-08-24 06:35:11 -04:00
parent 772797155b
commit 6f1806d0b8
2 changed files with 4 additions and 3 deletions

View File

@@ -344,9 +344,10 @@ arena_allocator.reset(); // Reset arena memory
- **Error messages are human-readable only** - never parse message strings
- **Consistent error boundaries** - each component defines what it can/cannot recover from
- **Interface precondition violations are undefined behavior** - acceptable to skip checks for performance in hot paths
- **Error code types must be nodiscard** - mark error code enums with `[[nodiscard]]` to prevent silent failures
```cpp
enum class ParseResult { Success, InvalidJson, MissingField };
enum class [[nodiscard]] ParseResult { Success, InvalidJson, MissingField };
// System failure - abort immediately
void* memory = std::malloc(size);