0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-28 14:58:20 +02:00

ircd::util: Improve some comments; minor cleanup.

This commit is contained in:
Jason Volk 2020-05-28 15:17:05 -07:00
parent d9f8e0d0ab
commit 7064e4f349
2 changed files with 8 additions and 4 deletions

View file

@ -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
{

View file

@ -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
{