aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-09 23:07:43 +0100
committerMax Kellermann <max@duempel.org>2014-12-09 23:07:43 +0100
commit3ab0691eecac239aee9b780928438a7df7d8394d (patch)
tree416bef9a92ee3f9c4bded9b42141ed92edcc120c /src
parent1e073a196fa011e1581ebe8ead3823f8322257ca (diff)
downloadmpd-3ab0691eecac239aee9b780928438a7df7d8394d.tar.gz
mpd-3ab0691eecac239aee9b780928438a7df7d8394d.tar.xz
mpd-3ab0691eecac239aee9b780928438a7df7d8394d.zip
Util/Manual: add method Get()
May be more clear than operators.
Diffstat (limited to 'src')
-rw-r--r--src/util/Manual.hxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/util/Manual.hxx b/src/util/Manual.hxx
index dd5b7e02f..7b1023f41 100644
--- a/src/util/Manual.hxx
+++ b/src/util/Manual.hxx
@@ -92,20 +92,28 @@ public:
#endif
}
- operator T &() {
+ T &Get() {
return *(T *)data;
}
- operator const T &() const {
+ const T &Get() const {
return *(const T *)data;
}
+ operator T &() {
+ return Get();
+ }
+
+ operator const T &() const {
+ return Get();
+ }
+
T *operator->() {
- return (T *)data;
+ return &Get();
}
const T *operator->() const {
- return (T *)data;
+ return &Get();
}
};