template <typename T, typename Enable = void>
class ArgumentHolder
ArgumentHolder is a helper class to defer evaluation of trace arguments
and extend the lifetime of temporaries passed to trace macros.
By using decltype((expr)), we can detect if an argument is an lvalue
or an rvalue (temporary):
- For lvalues, we store a pointer to the existing object to avoid copies.
- For rvalues, we move the temporary into a std::optional to extend its
lifetime to the end of the duration scope.
Evaluation is deferred until assign() is called, which happens only if
tracing is enabled for the category, preventing overhead when disabled.