6#include <bond/core/config.h>
7#include <bond/core/exception.h>
16struct RecursionGuardStaticsHolder
19 static uint32_t maxDepth;
22 thread_local static uint32_t currentDepth;
26uint32_t RecursionGuardStaticsHolder<T>::maxDepth = 64;
29thread_local uint32_t RecursionGuardStaticsHolder<T>::currentDepth;
32class RecursionGuard : RecursionGuardStaticsHolder<void>
37 uint32_t depth = currentDepth;
38 if (depth >= maxDepth)
40 bond::ExceededMaxRecursionDepthException();
43 currentDepth = depth + 1;
static void SetMaxDepth(uint32_t value)
Sets the maximum recursion depth permitted.
Definition recursionguard.h:52
namespace bond
Definition apply.h:17