From 252647efce3bba8c84910681bdcf259eaedc9351 Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 22 Feb 2017 08:31:18 +0000 Subject: [PATCH] Core: One::Get (alternative to operator~) git-svn-id: svn://ultimatepp.org/upp/trunk@10871 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Other.h | 2 ++ uppsrc/Core/src.tpp/One$en-us.tpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/uppsrc/Core/Other.h b/uppsrc/Core/Other.h index 07243605c..ac6469d85 100644 --- a/uppsrc/Core/Other.h +++ b/uppsrc/Core/Other.h @@ -40,6 +40,8 @@ public: T *operator->() { ASSERT(ptr); return ptr; } const T *operator~() const { return ptr; } T *operator~() { return ptr; } + const T *Get() const { return ptr; } + T *Get() { return ptr; } const T& operator*() const { ASSERT(ptr); return *ptr; } T& operator*() { ASSERT(ptr); return *ptr; } diff --git a/uppsrc/Core/src.tpp/One$en-us.tpp b/uppsrc/Core/src.tpp/One$en-us.tpp index dafa14e7b..f4c1c8ab8 100644 --- a/uppsrc/Core/src.tpp/One$en-us.tpp +++ b/uppsrc/Core/src.tpp/One$en-us.tpp @@ -103,11 +103,13 @@ pointer to content.&] [s4; &] [s5;:One`:`:operator`~`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* operator`~]()_[@(0.0.255) co nst]&] +[s5;:Upp`:`:One`:`:Get`(`)const: [@(0.0.255) const]_[*@4 T]_`*[* Get]()_[@(0.0.255) const]&] [s2;%% Constant content pointer access. Returns constant pointer to content or NULL when there is no content.&] [s3; &] [s4; &] [s5;:One`:`:operator`~`(`): [*@4 T]_`*[* operator`~]()&] +[s5;:Upp`:`:One`:`:Get`(`): [*@4 T]_`*[* Get]()&] [s2;%% Content pointer access. Returns pointer to content or NULL when there is no content.&] [s3; &]