From 69761389ffa46c4eaae3e31e25108e7923706203 Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Wed, 10 Nov 2021 21:18:19 +0530 Subject: [PATCH] Extend `OffsetMember` with direct `operator=`/`operator[]` It was found to be semantically advantageous to directly pass-through certain operators such as the assignment (`=`) and array index (`[]`) operators. These would require a dereference prior to their usage otherwise but now can be directly used. --- app/src/main/cpp/skyline/common/utils.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/cpp/skyline/common/utils.h b/app/src/main/cpp/skyline/common/utils.h index c7a2c22c..60914b31 100644 --- a/app/src/main/cpp/skyline/common/utils.h +++ b/app/src/main/cpp/skyline/common/utils.h @@ -243,6 +243,15 @@ namespace skyline::util { ValueType value; public: + OffsetMember &operator=(const ValueType &pValue) { + value = pValue; + return *this; + } + + auto operator[](std::size_t index) { + return value[index]; + } + ValueType &operator*() { return value; }