2424
2525namespace rtl
2626{
27- FORCE_INLINE RObject::RObject (const detail::RObjectId* pRObjId, std::any&& pObject, const Cloner* pCloner,
27+ FORCE_INLINE RObject::RObject (std::any&& pObject, const detail::RObjectId pRObjId , const Cloner* pCloner,
2828 const std::vector<traits::ConverterPair>* pConverters) noexcept
2929 : m_object(std::forward<std::any>(pObject))
30- , m_getClone(pCloner)
3130 , m_objectId(pRObjId)
31+ , m_getClone(pCloner)
3232 , m_converters(pConverters)
3333 { }
3434
3535 FORCE_INLINE RObject::RObject (RObject&& pOther) noexcept
3636 : m_object(std::move(pOther.m_object))
37- , m_getClone(pOther.m_getClone)
3837 , m_objectId(pOther.m_objectId)
38+ , m_getClone(pOther.m_getClone)
3939 , m_converters(pOther.m_converters)
4040 {
4141 // Explicitly clear moved-from source
4242 pOther.m_object .reset ();
43- pOther.m_objectId = nullptr ;
43+ pOther.m_objectId = {} ;
4444 pOther.m_getClone = nullptr ;
4545 pOther.m_converters = nullptr ;
4646 }
@@ -54,7 +54,7 @@ namespace rtl
5454
5555 inline std::size_t RObject::getConverterIndex (const std::size_t pToTypeId) const
5656 {
57- if (m_objectId-> m_containsAs != detail::EntityKind::None) {
57+ if (m_objectId. m_containsAs != detail::EntityKind::None) {
5858 for (std::size_t index = 0 ; index < m_converters->size (); index++) {
5959 if ((*m_converters)[index].first == pToTypeId) {
6060 return index;
@@ -70,12 +70,12 @@ namespace rtl
7070 {
7171 if constexpr (traits::is_bare_type<T>()) {
7272 if constexpr (traits::std_wrapper<T>::type != detail::Wrapper::None) {
73- if (m_objectId-> m_wrapperTypeId == traits::std_wrapper<T>::id ()) {
73+ if (m_objectId. m_wrapperTypeId == traits::std_wrapper<T>::id ()) {
7474 return true ;
7575 }
7676 }
7777 const auto & typeId = detail::TypeId<T>::get ();
78- return (m_objectId-> m_typeId == typeId || getConverterIndex (typeId) != index_none);
78+ return (m_objectId. m_typeId == typeId || getConverterIndex (typeId) != index_none);
7979 }
8080 }
8181
@@ -85,7 +85,7 @@ namespace rtl
8585 {
8686 detail::EntityKind newKind = detail::EntityKind::None;
8787 const traits::Converter& convert = (*m_converters)[pIndex].second ;
88- const std::any& viewObj = convert (m_object, m_objectId-> m_containsAs , newKind);
88+ const std::any& viewObj = convert (m_object, m_objectId. m_containsAs , newKind);
8989 const T* viewRef = detail::RObjExtractor::getPointer<T>(viewObj, newKind);
9090
9191 if (viewRef != nullptr && newKind == detail::EntityKind::Ref) {
@@ -105,7 +105,7 @@ namespace rtl
105105 {
106106 if constexpr (traits::is_bare_type<T>())
107107 {
108- if (detail::TypeId<T>::get () == m_objectId-> m_wrapperTypeId )
108+ if (detail::TypeId<T>::get () == m_objectId. m_wrapperTypeId )
109109 {
110110 using U = detail::RObjectUPtr<typename traits::std_wrapper<T>::value_type>;
111111 const U& uptrRef = *(detail::RObjExtractor (this ).getWrapper <T>());
@@ -121,7 +121,7 @@ namespace rtl
121121 {
122122 if constexpr (traits::is_bare_type<T>())
123123 {
124- if (detail::TypeId<T>::get () == m_objectId-> m_wrapperTypeId )
124+ if (detail::TypeId<T>::get () == m_objectId. m_wrapperTypeId )
125125 {
126126 const T& sptrRef = *(detail::RObjExtractor (this ).getWrapper <T>());
127127 return std::optional<rtl::view<T>>(std::in_place, const_cast <T&>(sptrRef));
@@ -137,7 +137,7 @@ namespace rtl
137137 if constexpr (traits::is_bare_type<T>())
138138 {
139139 const std::size_t asTypeId = detail::TypeId<T>::get ();
140- if (asTypeId == m_objectId-> m_typeId )
140+ if (asTypeId == m_objectId. m_typeId )
141141 {
142142 const T* valRef = detail::RObjExtractor (this ).getPointer <T>();
143143 if (valRef != nullptr ) {
@@ -184,10 +184,10 @@ namespace rtl
184184 template <>
185185 inline Return RObject::createCopy<alloc::Stack, detail::EntityKind::Wrapper>() const
186186 {
187- if (m_objectId-> m_wrapperType == detail::Wrapper::None) {
187+ if (m_objectId. m_wrapperType == detail::Wrapper::None) {
188188 return { error::NotWrapperType, RObject{} };
189189 }
190- else if (m_objectId-> m_wrapperType == detail::Wrapper::Unique)
190+ else if (m_objectId. m_wrapperType == detail::Wrapper::Unique)
191191 {
192192 return { error::TypeNotCopyConstructible, RObject{} };
193193 }
@@ -212,7 +212,7 @@ namespace rtl
212212 else if constexpr (_copyTarget == copy::Auto) {
213213 // RTL wraps the objects allocated on heap in 'std::unique_ptr'. Which by default is transparent to RTL itself.
214214 // 'std::unique_ptr' acquired via any other source, (e.g. return value) are not transparent. hence the second condition.
215- if (m_objectId-> m_wrapperType != detail::Wrapper::None && !isAllocatedByRtl ())
215+ if (m_objectId. m_wrapperType != detail::Wrapper::None && !isAllocatedByRtl ())
216216 {
217217 return createCopy<_allocOn, detail::EntityKind::Wrapper>();
218218 }
0 commit comments