|
EnigmaMachineCore 0.1.0
A modular Enigma Machine simulation in C++20
|
Accepted
The Enigma Machine Core is designed to be universal, and it targets platforms that do not support exceptions (-fno-exceptions) or where exceptions are discouraged for performance reasons (e.g., Embedded systems, WASM).
Currently, the engine uses:
std::runtime_error and std::invalid_argument are thrown in constructors and configuration loaders.std::cerr or simple boolean returns.We will transition from C++ exceptions to the **std::expected** (C++23) pattern for reporting errors in public and internal APIs.
keyTransform and configuration loaders will return a Result<T> (aliased to std::expected<T, ErrorCode>).-fno-exceptions without losing error-reporting capability.throw statements in the core logic will be removed or conditionally enabled for rich targets only.ErrorCode values representing configuration failures, validation errors, and runtime issues.Result or Go's error handling.tl::expected) if C++23 is not yet available in all target compilers.