diff --git a/include/ircd/life_guard.h b/include/ircd/life_guard.h index ec9f4346f..cbb653e47 100644 --- a/include/ircd/life_guard.h +++ b/include/ircd/life_guard.h @@ -22,6 +22,15 @@ #pragma once #define HAVE_IRCD_LIFE_GUARD_H +// +// life_guard is a convenience which takes advantage of +// std::enable_shared_from_this. The life_guard glorifies the constructor +// of an std::shared_ptr by accepting std::weak_ptr and T& itself all +// with proper semantics. Once construction is successful, the user holds it +// for the duration of the scope ensuring T& survives context interleaving +// without being destructed. +// + namespace ircd { // Tests if type inherits from std::enable_shared_from_this<>