From 5d78d88f9104e115ed54fa6186d6748cd442b5b7 Mon Sep 17 00:00:00 2001 From: Basit Ayantunde Date: Thu, 5 Dec 2024 23:46:41 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20made=20super's=20members=20priva?= =?UTF-8?q?te?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ashura/std/super.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ashura/std/super.h b/ashura/std/super.h index 911ca38a..98d365ee 100644 --- a/ashura/std/super.h +++ b/ashura/std/super.h @@ -41,11 +41,11 @@ struct Super } }; - alignas(ALIGNMENT) mutable u8 storage[CAPACITY]; + alignas(ALIGNMENT) mutable u8 storage_[CAPACITY]; - Base * base_ptr; + Base * base_; - Lifecycle lifecycle; + Lifecycle lifecycle_; template requires (Derives && ALIGNMENT >= alignof(Object) && @@ -63,11 +63,11 @@ struct Super template requires (ALIGNMENT >= SrcAlignment && CAPACITY >= SrcCapacity) constexpr Super(Super && other) : - lifecycle{other.lifecycle} + lifecycle_{other.lifecycle_} { - other.lifecycle(other.storage, storage, &base_ptr); - other.lifecycle = noop; - other.base_ptr = nullptr; + other.lifecycle_(other.storage_, storage_, &base_); + other.lifecycle_ = noop; + other.base_ = nullptr; } template @@ -82,28 +82,28 @@ struct Super } } - lifecycle(storage, nullptr, nullptr); - other.lifecycle(other.storage, storage, &base_ptr); - lifecycle = other.lifecycle; - other.lifecycle = noop; - other.base_ptr = nullptr; + lifecycle_(storage_, nullptr, nullptr); + other.lifecycle_(other.storage_, storage_, &base_); + lifecycle_ = other.lifecycle_; + other.lifecycle_ = noop; + other.base_ = nullptr; return *this; } constexpr operator Base &() const { - return *base_ptr; + return *base_; } constexpr Base & get() const { - return *base_ptr; + return *base_; } constexpr ~Super() { - lifecycle(storage, nullptr, nullptr); + lifecycle_(storage_, nullptr, nullptr); } };