3 ms·
> or if exceptions were crucial Although KJ style prefers exceptions, the library is carefully written (and tested) to work with -fno-exceptions. KJ_ASSERT/KJ_
by kentonv 9y ago
> or if exceptions were crucial
Although KJ style prefers exceptions, the library is carefully written (and tested) to work with -fno-exceptions. KJ_ASSERT/KJ_REQUIRE invocations (which normally throw exceptions) can define a fallback path to use in the case that exceptions are disabled, usually involving returning some sort of dummy value. You can also register a per-thread exception callback which will be called on all exceptions before the fallback starts (or before aborting, if there is no fallback).
- elcritch 9y agoThat’s excellent! That certainly makes it seem much more useful for many embedded environments.