From 5ad7c963b13efb7cfe34b2ff5812a99f2506336a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 17 Apr 2021 18:15:12 -0500 Subject: [PATCH] [nostalgia] Add new oxRequire variants to handbook --- developer-handbook.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/developer-handbook.md b/developer-handbook.md index 03ba413da..3e788b667 100644 --- a/developer-handbook.md +++ b/developer-handbook.md @@ -259,12 +259,18 @@ ox::Result f() { } ox::Result f2() { - oxRequire(i, f()); // creates i and assigns it the value returned by f, returns if there was an error + oxRequire(i, f()); // const auto [out, oxConcat(oxRequire_err_, __LINE__)] = x; oxReturnError(oxConcat(oxRequire_err_, __LINE__)) return i + 4; } ``` ```oxRequire``` is not quite as versatile, but it should still cleanup a lot of otherwise less ideal code. +```oxRequire``` also has variants for throwing the error and for making to value non-const: + +* ```oxRequireM``` - oxRequire Mutable +* ```oxRequireT``` - oxRequire Throw +* ```oxRequireMT``` - oxRequire Mutable Throw + ### Logging Ox provides for logging and debug prints via the ```oxTrace```, ```oxDebug```, and ```oxError``` macros.