diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-16 15:12:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-16 18:04:35 +0200 |
commit | 707edf55646b62d74a3ff3de9acc274687c13e05 (patch) | |
tree | 4905fb9f2e03436cf899ca2fde1cfd9aefa67fa8 /options | |
parent | b9df690652818ed91097cb9f24854022f823d35e (diff) |
options/value: allow for deref operator
C++ expects pointer so let it have it.
Diffstat (limited to 'options')
-rw-r--r-- | options/value.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/options/value.hpp b/options/value.hpp index 06b231c1..ccec36a4 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -178,6 +178,12 @@ public: emit valueChanged(static_cast<detail::value_type_t<t>>(get())); } + element_type const* operator->() const + { + static thread_local element_type last; + last = get(); + return &last; + } private: t def; }; |