component_tuple

template<typename ...Types>
class component_tuple : public tim::bundle<TIMEMORY_API, component_tuple<>, tim::variadic::stack_wrapper_types<concat<Types...>>>, public tim::concepts::stack_wrapper

This is a variadic component wrapper where all components are allocated on the stack and cannot be disabled at runtime. This bundler has the lowest overhead. Accepts unlimited number of template parameters. This bundler is used by tim::auto_tuple whose constructor and destructor invoke the start() and stop() member functions respectively.

using bundle_t = tim::component_tuple<wall_clock, cpu_clock, peak_rss>;

void foo()
{
    auto bar = bundle_t("foo");
    bar.start();
    // ...
    bar.stop();
}
tparam Types

Specification of the component types to bundle together

The above code will record wall-clock, cpu-clock, and peak-rss. The intermediate storage will happen on the stack and when the destructor is called, it will add itself to the call-graph