Commit 3ab0691e authored by Max Kellermann's avatar Max Kellermann

Util/Manual: add method Get()

May be more clear than operators.
parent 1e073a19
...@@ -92,20 +92,28 @@ public: ...@@ -92,20 +92,28 @@ public:
#endif #endif
} }
operator T &() { T &Get() {
return *(T *)data; return *(T *)data;
} }
operator const T &() const { const T &Get() const {
return *(const T *)data; return *(const T *)data;
} }
operator T &() {
return Get();
}
operator const T &() const {
return Get();
}
T *operator->() { T *operator->() {
return (T *)data; return &Get();
} }
const T *operator->() const { const T *operator->() const {
return (T *)data; return &Get();
} }
}; };
......
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