Commit 5e2af15e authored by Max Kellermann's avatar Max Kellermann

util/Manual: add static method Cast()

parent 3fbb54e0
...@@ -62,6 +62,13 @@ public: ...@@ -62,6 +62,13 @@ public:
} }
#endif #endif
/**
* Cast a value reference to the containing Manual instance.
*/
static constexpr Manual<T> &Cast(T &value) {
return reinterpret_cast<Manual<T> &>(value);
}
template<typename... Args> template<typename... Args>
void Construct(Args&&... args) { void Construct(Args&&... args) {
assert(!initialized); assert(!initialized);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment