diff --git a/include/ircd/util/typography.h b/include/ircd/util/typography.h index 4fb6f7354..b9daf2089 100644 --- a/include/ircd/util/typography.h +++ b/include/ircd/util/typography.h @@ -162,6 +162,28 @@ mutable_cast(T *const t) return const_cast(t); } +// +// Convenience involatile cast template +// + +template +[[using gnu: always_inline, gnu_inline, artificial]] +extern inline typename std::remove_volatile::type & +involatile_cast(T &t) +{ + using type = typename std::remove_volatile::type; + return const_cast(t); +} + +template +[[using gnu: always_inline, gnu_inline, artificial]] +extern inline typename std::remove_volatile::type * +involatile_cast(T *const t) +{ + using type = typename std::remove_volatile::type; + return const_cast(t); +} + // // Test if type is shared_from_this //