Util/Manual: add method Get()

May be more clear than operators.
This commit is contained in:
Max Kellermann 2014-12-09 23:07:43 +01:00
parent 1e073a196f
commit 3ab0691eec

View File

@ -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();
} }
}; };