Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/BLI_user_counter.hh')
-rw-r--r--source/blender/blenlib/BLI_user_counter.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_user_counter.hh b/source/blender/blenlib/BLI_user_counter.hh
index 3e6d5af4c3f..8cebadeac4c 100644
--- a/source/blender/blenlib/BLI_user_counter.hh
+++ b/source/blender/blenlib/BLI_user_counter.hh
@@ -84,12 +84,24 @@ template<typename T> class UserCounter {
return data_;
}
+ const T *operator->() const
+ {
+ BLI_assert(data_ != nullptr);
+ return data_;
+ }
+
T &operator*()
{
BLI_assert(data_ != nullptr);
return *data_;
}
+ const T &operator*() const
+ {
+ BLI_assert(data_ != nullptr);
+ return *data_;
+ }
+
operator bool() const
{
return data_ != nullptr;