mirror of
https://github.com/matrix-construct/construct
synced 2024-10-04 14:48:56 +02:00
ircd: Add commentary to life_guard.
This commit is contained in:
parent
c43c8f83d3
commit
e567293dde
1 changed files with 9 additions and 0 deletions
|
@ -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<T>. The life_guard glorifies the constructor
|
||||
// of an std::shared_ptr<T> by accepting std::weak_ptr<T> 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<>
|
||||
|
|
Loading…
Reference in a new issue