summaryrefslogtreecommitdiff
path: root/src/bindings/cxx/eo_cxx/eo_wref.hh
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-02 18:39:47 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 09:57:24 +0900
commite7009b77a235ece2bbcba24c4fc6e2b719a2ab8d (patch)
treec3c56f591ba9769c45078f74125e93722d330b46 /src/bindings/cxx/eo_cxx/eo_wref.hh
parent73ec85aeffc2eddfe81673344ed22bb21461aaa7 (diff)
cxx: Add experimental "easy" way to use wref
I hid it behind ifdef for now as I'm very much unsure of what I'm doing. This whole modern C++ thing is still weird to me :) Prerequisite: #define EFL_CXX_WREF_EASY This allows constructs such as: auto wobj = obj._get_wref(); std::cout << wobj->text_get() << std::endl;
Diffstat (limited to 'src/bindings/cxx/eo_cxx/eo_wref.hh')
-rw-r--r--src/bindings/cxx/eo_cxx/eo_wref.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bindings/cxx/eo_cxx/eo_wref.hh b/src/bindings/cxx/eo_cxx/eo_wref.hh
index e0f9c7bf82..124b1da3b7 100644
--- a/src/bindings/cxx/eo_cxx/eo_wref.hh
+++ b/src/bindings/cxx/eo_cxx/eo_wref.hh
@@ -123,6 +123,18 @@ struct wref
123 return *this; 123 return *this;
124 } 124 }
125 125
126#ifdef EFL_CXX_WREF_EASY
127 T operator->() const {
128 if (!_eo_wref) return T(nullptr);
129 return T(detail::ref(_eo_wref));
130 }
131
132 T operator*() const {
133 if (!_eo_wref) return T(nullptr);
134 return T(detail::ref(_eo_wref));
135 }
136#endif
137
126private: 138private:
127 void _add() 139 void _add()
128 { 140 {