mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd::util: Improve some comments; minor cleanup.
This commit is contained in:
parent
d9f8e0d0ab
commit
7064e4f349
2 changed files with 8 additions and 4 deletions
|
@ -15,11 +15,12 @@ namespace ircd {
|
|||
inline namespace util
|
||||
{
|
||||
template<class T> struct scope_count;
|
||||
}};
|
||||
}}
|
||||
|
||||
/// A simple boiler-plate for incrementing a counter when constructed and
|
||||
/// decrementing it to its previous value when destructed. This takes a runtime
|
||||
/// reference to that counter.
|
||||
/// Increment a counter when constructed and decrement it when destructed.
|
||||
/// This takes a runtime reference to that counter. The counter thus maintains
|
||||
/// the number of reentrances (or entrances across different contexts).
|
||||
///
|
||||
template<class T>
|
||||
struct ircd::util::scope_count
|
||||
{
|
||||
|
|
|
@ -17,6 +17,9 @@ inline namespace util
|
|||
template<class T> struct scope_restore;
|
||||
}}
|
||||
|
||||
/// Overwrite a value for the duration of the instance restoring the
|
||||
/// original value at destruction. Device cannot be moved or copied.
|
||||
///
|
||||
template<class T>
|
||||
struct ircd::util::scope_restore
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue