From 230090f2e0e9cbed39ff5394a91524e011194222 Mon Sep 17 00:00:00 2001 From: neeraj31285 Date: Mon, 5 Oct 2026 20:20:45 +0530 Subject: [PATCH 1/2] removed custom GETTER macros. --- CxxTestProps/inc/AbstractClass.h | 22 ++++++ .../MoveConstructorTests.cpp | 2 +- .../rtl/detail/inc/RObjectId.h | 9 ++- .../rtl/dispatch/forward_call.h | 22 ++++-- ReflectionTemplateLib/rtl/dispatch/functor.h | 24 +++++-- ReflectionTemplateLib/rtl/inc/Function.h | 48 ++++++++++--- ReflectionTemplateLib/rtl/inc/Function.hpp | 5 +- ReflectionTemplateLib/rtl/inc/RObject.h | 47 ++++++++++-- ReflectionTemplateLib/rtl/inc/Record.h | 22 +++++- ReflectionTemplateLib/rtl/inc/type_meta.h | 71 +++++++++++++++---- ReflectionTemplateLib/rtl/rtl_constants.h | 29 -------- ReflectionTemplateLib/rtl/rtl_constructor.h | 29 +++++--- ReflectionTemplateLib/rtl/rtl_function.h | 10 +-- ReflectionTemplateLib/rtl/rtl_method.h | 6 +- ReflectionTemplateLib/rtl/rtl_method_const.h | 8 ++- ReflectionTemplateLib/rtl/rtl_method_erased.h | 9 ++- .../rtl/rtl_method_erased_return.h | 9 ++- .../rtl/rtl_method_erased_target.h | 9 ++- 18 files changed, 282 insertions(+), 99 deletions(-) create mode 100644 CxxTestProps/inc/AbstractClass.h diff --git a/CxxTestProps/inc/AbstractClass.h b/CxxTestProps/inc/AbstractClass.h new file mode 100644 index 00000000..a7820edd --- /dev/null +++ b/CxxTestProps/inc/AbstractClass.h @@ -0,0 +1,22 @@ +#pragma once + +class Abstract +{ +public: + + virtual ~Abstract() = 0 { } + + void reset() { + + } + + static Abstract* create(); +}; + +class AbstractNode : public Abstract +{ +}; + +Abstract* Abstract::create() { + return new AbstractNode(); +} diff --git a/RTLTestRunApp/src/FunctionalityTests/MoveConstructorTests.cpp b/RTLTestRunApp/src/FunctionalityTests/MoveConstructorTests.cpp index 673a6f1a..5f8296fe 100644 --- a/RTLTestRunApp/src/FunctionalityTests/MoveConstructorTests.cpp +++ b/RTLTestRunApp/src/FunctionalityTests/MoveConstructorTests.cpp @@ -57,7 +57,7 @@ namespace rtl_tests // 'Event' has a unique_ptr and two 'Event' instances exists, So- EXPECT_TRUE(date::get_instance_count() == 2); { - // Cloning a moved-from object ie an empty object; + // Deliberatly cloning a moved-from object ie an empty object; auto [err, ret] = calender0.clone(); EXPECT_TRUE(err == error::EmptyRObject); ASSERT_TRUE(ret.isEmpty()); diff --git a/ReflectionTemplateLib/rtl/detail/inc/RObjectId.h b/ReflectionTemplateLib/rtl/detail/inc/RObjectId.h index 7943655a..cba2e55e 100644 --- a/ReflectionTemplateLib/rtl/detail/inc/RObjectId.h +++ b/ReflectionTemplateLib/rtl/detail/inc/RObjectId.h @@ -31,8 +31,13 @@ namespace rtl::detail const std::vector* m_converters = nullptr; - GETTER(traits::uid_t, TypeId, m_typeId) - GETTER(EntityKind, ContainedAs, m_containsAs) + constexpr const traits::uid_t getTypeId() const { + return m_typeId; + } + + constexpr const EntityKind getContainedAs() const { + return m_containsAs; + } template static constexpr const std::vector& getConverters() noexcept diff --git a/ReflectionTemplateLib/rtl/dispatch/forward_call.h b/ReflectionTemplateLib/rtl/dispatch/forward_call.h index 915bbfaa..89583be5 100644 --- a/ReflectionTemplateLib/rtl/dispatch/forward_call.h +++ b/ReflectionTemplateLib/rtl/dispatch/forward_call.h @@ -68,8 +68,13 @@ namespace rtl::dispatch } } - GETTER(error, _init_error, m_init_err) - GETTER(traits::uid_t, _record_id, m_record_id) + constexpr const error get_init_error() const { + return m_init_err; + } + + constexpr const traits::uid_t get_record_id() const { + return m_record_id; + } private: @@ -81,8 +86,13 @@ namespace rtl::dispatch std::vector m_hopper = {}; std::vector m_functors = {}; - GETTER_REF(std::vector, _hopper, m_hopper) - GETTER_REF(std::vector, _overloads, m_functors) + constexpr std::vector& get_hopper() { + return m_hopper; + } + + constexpr std::vector& get_overloads() { + return m_functors; + } void set_init_error(error p_err) { m_init_err = p_err; @@ -92,10 +102,10 @@ namespace rtl::dispatch m_record_id = p_recid; } - template + template friend struct detail::InitFunctionHop; - template + template friend struct detail::InitMethodHop; }; } \ No newline at end of file diff --git a/ReflectionTemplateLib/rtl/dispatch/functor.h b/ReflectionTemplateLib/rtl/dispatch/functor.h index e87cad4e..40eb62c1 100644 --- a/ReflectionTemplateLib/rtl/dispatch/functor.h +++ b/ReflectionTemplateLib/rtl/dispatch/functor.h @@ -17,11 +17,25 @@ namespace rtl::dispatch { struct functor { - GETTER_BOOL(_void, m_is_void) - GETTER_BOOL(_any_arg_ncref, m_is_any_arg_ncref) - GETTER(traits::uid_t, _record_id, m_record_id) - GETTER(traits::uid_t, _strict_sign_id, m_strict_args_id) - GETTER(traits::uid_t, _normal_sign_id, m_normal_args_id) + constexpr const bool is_void() const { + return m_is_void; + } + + constexpr const bool is_any_arg_ncref() const { + return m_is_any_arg_ncref; + } + + constexpr const traits::uid_t get_record_id() const { + return m_record_id; + } + + constexpr const traits::uid_t get_strict_sign_id() const { + return m_strict_args_id; + } + + constexpr const traits::uid_t get_normal_sign_id() const { + return m_normal_args_id; + } protected: diff --git a/ReflectionTemplateLib/rtl/inc/Function.h b/ReflectionTemplateLib/rtl/inc/Function.h index 8326336d..4f05062c 100644 --- a/ReflectionTemplateLib/rtl/inc/Function.h +++ b/ReflectionTemplateLib/rtl/inc/Function.h @@ -48,18 +48,10 @@ namespace rtl bool hasSignatureId(const traits::uid_t pSignatureId) const; - GETTER_REF_C(std::vector, Functors, m_functorsMeta) + constexpr std::vector& getFunctors() const; public: - //simple inlined getters. - GETTER(detail::member, MemberKind, m_member_kind); - GETTER(traits::uid_t, RecordTypeId, m_recordTypeId); - - GETTER_CREF(std::string, RecordName, m_recordStr); - GETTER_CREF(std::string, FunctionName, m_function); - GETTER_CREF(std::vector, FunctorsMeta, m_functorsMeta) - Function() = default; Function(Function&&) = default; Function(const Function&) = default; @@ -72,7 +64,45 @@ namespace rtl template constexpr bool hasSignature() const; + constexpr const std::string& getRecordName() const; + + constexpr const std::string& getFunctionName() const; + + constexpr const detail::member getMemberKind() const; + + constexpr const traits::uid_t getRecordTypeId() const; + + constexpr const std::vector& getFunctorsMeta() const; + friend detail::CxxReflection; friend builder::ReflectionBuilder; }; +} + + +namespace rtl +{ + constexpr std::vector& Function::getFunctors() const { + return m_functorsMeta; + } + + constexpr const detail::member Function::getMemberKind() const { + return m_member_kind; + }; + + constexpr const traits::uid_t Function::getRecordTypeId() const { + return m_recordTypeId; + }; + + constexpr const std::string& Function::getRecordName() const { + return m_recordStr; + }; + + constexpr const std::string& Function::getFunctionName() const { + return m_function; + }; + + constexpr const std::vector& Function::getFunctorsMeta() const { + return m_functorsMeta; + } } \ No newline at end of file diff --git a/ReflectionTemplateLib/rtl/inc/Function.hpp b/ReflectionTemplateLib/rtl/inc/Function.hpp index 448e4ab8..1bb3bd0a 100644 --- a/ReflectionTemplateLib/rtl/inc/Function.hpp +++ b/ReflectionTemplateLib/rtl/inc/Function.hpp @@ -17,7 +17,7 @@ namespace rtl { template - inline constexpr const detail::InitFunctionHop Function::argsT() const + constexpr const detail::InitFunctionHop Function::argsT() const { return detail::HopBuilder{ m_functorsMeta }.argsT(); } @@ -29,7 +29,7 @@ namespace rtl * a single 'Function' object can be associated with multiple overloads of same function. * the set of arguments passed is checked against all registered overloads, returns true if matched with any one. */ template - inline constexpr bool Function::hasSignature() const + constexpr bool Function::hasSignature() const { return hasSignatureId(traits::uid>::value); } @@ -37,7 +37,6 @@ namespace rtl inline bool Function::hasSignatureId(const traits::uid_t pSignatureId) const { - //simple linear-search, efficient for small set of elements. for (const auto& fnMeta : m_functorsMeta) { if (fnMeta.get_strict_args_id() == pSignatureId) [[likely]] { return true; diff --git a/ReflectionTemplateLib/rtl/inc/RObject.h b/ReflectionTemplateLib/rtl/inc/RObject.h index 1f45143f..f5f858ea 100644 --- a/ReflectionTemplateLib/rtl/inc/RObject.h +++ b/ReflectionTemplateLib/rtl/inc/RObject.h @@ -45,7 +45,7 @@ namespace rtl template std::optional> performConversion(const std::size_t pIndex) const; - GETTER_BOOL(ConstCastSafe, m_objectId.m_isConstCastSafe) + constexpr const bool isConstCastSafe() const; public: @@ -56,11 +56,13 @@ namespace rtl RObject(RObject&&) noexcept; RObject& operator=(RObject&&) noexcept; - GETTER_BOOL(Empty, (m_object == std::nullopt || !m_object->has_value())) - GETTER_BOOL(OnHeap, (m_objectId.m_allocatedOn == alloc::Heap)) - GETTER_BOOL(AllocatedByRtl, (m_objectId.m_allocatedOn == alloc::Heap)) - GETTER(std::size_t, TypeId, m_objectId.m_typeId) - GETTER_CREF(std::optional, Any, m_object) + constexpr const bool isEmpty() const; + + constexpr const bool isOnHeap() const; + + constexpr const bool isAllocatedByRtl() const; + + constexpr const std::size_t getTypeId() const; template bool canViewAs() const; @@ -99,9 +101,42 @@ namespace rtl template friend struct method; }; +} + +namespace rtl +{ struct [[nodiscard]] Return { error err; RObject robject; }; +} + + +namespace rtl +{ + constexpr const bool RObject::isConstCastSafe() const + { + return m_objectId.m_isConstCastSafe; + } + + constexpr const bool RObject::isEmpty() const + { + return (m_object == std::nullopt || !m_object->has_value()); + } + + constexpr const bool RObject::isOnHeap() const + { + return (m_objectId.m_allocatedOn == alloc::Heap); + } + + constexpr const bool RObject::isAllocatedByRtl() const + { + return (m_objectId.m_allocatedOn == alloc::Heap); + } + + constexpr const std::size_t RObject::getTypeId() const + { + return m_objectId.m_typeId; + } } \ No newline at end of file diff --git a/ReflectionTemplateLib/rtl/inc/Record.h b/ReflectionTemplateLib/rtl/inc/Record.h index 7ee5d64a..feb4d58e 100644 --- a/ReflectionTemplateLib/rtl/inc/Record.h +++ b/ReflectionTemplateLib/rtl/inc/Record.h @@ -39,7 +39,7 @@ namespace rtl , m_recordName(pRecordName) { } - GETTER_REF_C(MethodMap, FunctionsMap, m_methods) + constexpr MethodMap& getFunctionsMap() const; public: @@ -49,8 +49,8 @@ namespace rtl Record& operator=(Record&&) = default; Record& operator=(const Record&) = default; - GETTER_CREF(MethodMap, MethodMap, m_methods) - GETTER_CREF(std::string, RecordName, m_recordName) + constexpr const MethodMap& getMethodMap() const; + constexpr const std::string& getRecordName() const; template constructor ctorT() const; @@ -71,4 +71,20 @@ namespace rtl //only class which can create objects of this class & manipulates 'm_methods'. friend class detail::CxxReflection; }; +} + + +namespace rtl +{ + constexpr Record::MethodMap& Record::getFunctionsMap() const { + return m_methods; + } + + constexpr const Record::MethodMap& Record::getMethodMap() const { + return m_methods; + } + + constexpr const std::string& Record::getRecordName() const { + return m_recordName; + } } \ No newline at end of file diff --git a/ReflectionTemplateLib/rtl/inc/type_meta.h b/ReflectionTemplateLib/rtl/inc/type_meta.h index f8abaed8..86e0d213 100644 --- a/ReflectionTemplateLib/rtl/inc/type_meta.h +++ b/ReflectionTemplateLib/rtl/inc/type_meta.h @@ -27,21 +27,20 @@ namespace rtl type_meta& operator=(type_meta&&) = default; type_meta& operator=(const type_meta&) = default; - GETTER_BOOL(_empty, !m_functor.has_value()) - GETTER_BOOL(_void, m_functor->get().m_is_void) - GETTER_BOOL(_any_arg_ncref, m_functor->get().m_is_any_arg_ncref) + constexpr const bool is_void() const; + constexpr const bool is_empty() const; + constexpr const bool is_any_arg_ncref() const; - GETTER(std::string, _signature_str, m_functor->get().m_signature_str) - GETTER_CREF(std::vector, _args_id_arr, m_functor->get().m_args_type_ids) + constexpr const std::string get_signature_str() const; + constexpr const std::vector& get_args_id_arr() const; - GETTER(traits::uid_t, _return_id, m_functor->get().m_return_id) - GETTER(traits::uid_t, _record_id, m_functor->get().m_record_id) - GETTER(traits::uid_t, _normal_args_id, m_functor->get().m_normal_args_id) - GETTER(traits::uid_t, _strict_args_id, m_functor->get().m_strict_args_id) + constexpr const detail::member get_member_kind() const; + constexpr const dispatch::functor& get_functor() const; - GETTER(detail::member, _member_kind, m_functor->get().m_member_kind) - - GETTER_CREF(dispatch::functor, _functor, m_functor->get()) + constexpr const traits::uid_t get_record_id() const; + constexpr const traits::uid_t get_return_id() const; + constexpr const traits::uid_t get_normal_args_id() const; + constexpr const traits::uid_t get_strict_args_id() const; template static type_meta add_function(return_t(*p_fptr)(signature_t...), @@ -72,4 +71,52 @@ namespace rtl friend detail::CxxReflection; }; +} + + +namespace rtl +{ + constexpr const bool type_meta::is_empty() const { + return !m_functor.has_value(); + } + + constexpr const bool type_meta::is_void() const { + return m_functor->get().m_is_void; + } + + constexpr const bool type_meta::is_any_arg_ncref() const { + return m_functor->get().m_is_any_arg_ncref; + } + + constexpr const std::string type_meta::get_signature_str() const { + return m_functor->get().m_signature_str; + } + + constexpr const traits::uid_t type_meta::get_return_id() const { + return m_functor->get().m_return_id; + } + + constexpr const traits::uid_t type_meta::get_record_id() const { + return m_functor->get().m_record_id; + } + + constexpr const traits::uid_t type_meta::get_normal_args_id() const { + return m_functor->get().m_normal_args_id; + } + + constexpr const traits::uid_t type_meta::get_strict_args_id() const { + return m_functor->get().m_strict_args_id; + } + + constexpr const detail::member type_meta::get_member_kind() const { + return m_functor->get().m_member_kind; + } + + constexpr const dispatch::functor& type_meta::get_functor() const { + return m_functor->get(); + } + + constexpr const std::vector& type_meta::get_args_id_arr() const { + return m_functor->get().m_args_type_ids; + } } \ No newline at end of file diff --git a/ReflectionTemplateLib/rtl/rtl_constants.h b/ReflectionTemplateLib/rtl/rtl_constants.h index 8fc1ec33..97e1ad73 100644 --- a/ReflectionTemplateLib/rtl/rtl_constants.h +++ b/ReflectionTemplateLib/rtl/rtl_constants.h @@ -119,35 +119,6 @@ namespace rtl::detail return (pRecordName + "::" + pRecordName + "()"); } -#define GETTER(_varType, _name, _var) \ - inline constexpr const _varType get##_name() const { \ - return _var; \ - } - -#define GETTER_REF_C(_varType, _name, _var) \ - inline constexpr _varType& get##_name() const { \ - return _var; \ - } - -#define GETTER_REF(_varType, _name, _var) \ - inline constexpr _varType& get##_name() { \ - return _var; \ - } - -#define GETTER_CPTR(_varType, _name, _var) \ - inline constexpr const _varType* get##_name() const { \ - return _var; \ - } - -#define GETTER_CREF(_varType, _name, _var) \ - inline constexpr const _varType& get##_name() const { \ - return _var; \ - } - -#define GETTER_BOOL(_name, _var) \ - inline constexpr const bool is##_name() const { \ - return _var; \ - } #if defined(_MSC_VER) #define ForceInline __forceinline diff --git a/ReflectionTemplateLib/rtl/rtl_constructor.h b/ReflectionTemplateLib/rtl/rtl_constructor.h index 4163059d..cc47e9af 100644 --- a/ReflectionTemplateLib/rtl/rtl_constructor.h +++ b/ReflectionTemplateLib/rtl/rtl_constructor.h @@ -27,8 +27,16 @@ namespace rtl std::vector m_functors = {}; - GETTER_REF(std::vector, _hop, m_hop) - GETTER_REF(std::vector, _overloads, m_functors) + + constexpr std::vector& get_hop() { + return m_hop; + } + + + constexpr std::vector& get_overloads() { + return m_functors; + } + void set_init_error(error p_err) { m_init_err = p_err; @@ -36,18 +44,26 @@ namespace rtl public: - GETTER(rtl::error, _init_error, m_init_err) + friend Record; + static_assert((!std::is_reference_v && ...), "rtl::function<...>: any type cannot be specified as reference here"); + + constexpr const rtl::error get_init_error() const { + return m_init_err; + } + constexpr operator bool() const noexcept { return !(m_init_err != error::None || m_functors.empty() || (m_functors.size() == 1 && m_functors[0] == nullptr)); } + constexpr bool must_bind_refs() const noexcept { return (m_functors[detail::call_by::value] == nullptr && (m_functors.size() > detail::call_by::ncref || m_functors[detail::call_by::cref]->is_any_arg_ncref())); } + template requires (sizeof...(args_t) == sizeof...(signature_t)) constexpr Return operator()(alloc p_alloc_on, args_t&&...params) const noexcept @@ -64,6 +80,7 @@ namespace rtl return m_hop[index](p_alloc_on, std::forward(params)...); } + template struct perfect_fwd { @@ -89,15 +106,11 @@ namespace rtl } }; + template requires (std::is_same_v, std::tuple>) constexpr const perfect_fwd bind() const noexcept { return perfect_fwd{ *this }; } - - friend Record; - - static_assert((!std::is_reference_v && ...), - "rtl::function<...>: any type cannot be specified as reference here"); }; } \ No newline at end of file diff --git a/ReflectionTemplateLib/rtl/rtl_function.h b/ReflectionTemplateLib/rtl/rtl_function.h index c7a4423e..bfec90bd 100644 --- a/ReflectionTemplateLib/rtl/rtl_function.h +++ b/ReflectionTemplateLib/rtl/rtl_function.h @@ -29,6 +29,10 @@ namespace rtl return (m_functor != nullptr); } + constexpr const rtl::error get_init_error() const { + return m_init_err; + } + template [[nodiscard]] [[gnu::hot]] constexpr decltype(auto) operator()(args_t&&...params) const noexcept @@ -48,8 +52,6 @@ namespace rtl function& operator=(function&&) = default; function& operator=(const function&) = default; - GETTER(rtl::error, _init_error, m_init_err) - protected: fptr_t m_functor = nullptr; @@ -59,7 +61,7 @@ namespace rtl m_init_err = p_err; } - template + template friend struct detail::InitFunctionHop; }; } @@ -82,7 +84,7 @@ namespace rtl static_method& operator=(static_method&&) = default; static_method& operator=(const static_method&) = default; - template + template friend struct detail::InitFunctionHop; }; } \ No newline at end of file diff --git a/ReflectionTemplateLib/rtl/rtl_method.h b/ReflectionTemplateLib/rtl/rtl_method.h index e570d192..e0676a91 100644 --- a/ReflectionTemplateLib/rtl/rtl_method.h +++ b/ReflectionTemplateLib/rtl/rtl_method.h @@ -29,6 +29,10 @@ namespace rtl return (m_functor != nullptr); } + constexpr const rtl::error get_init_error() const { + return m_init_err; + } + struct invoker { fptr_t functor; @@ -65,8 +69,6 @@ namespace rtl method& operator=(method&&) = default; method& operator=(const method&) = default; - GETTER(rtl::error, _init_error, m_init_err) - private: fptr_t m_functor = nullptr; diff --git a/ReflectionTemplateLib/rtl/rtl_method_const.h b/ReflectionTemplateLib/rtl/rtl_method_const.h index 572513ab..ef226e27 100644 --- a/ReflectionTemplateLib/rtl/rtl_method_const.h +++ b/ReflectionTemplateLib/rtl/rtl_method_const.h @@ -29,6 +29,10 @@ namespace rtl return (m_functor != nullptr); } + constexpr const rtl::error get_init_error() const { + return m_init_err; + } + struct invoker { fptr_t functor; @@ -60,8 +64,6 @@ namespace rtl const_method& operator=(const_method&&) = default; const_method& operator=(const const_method&) = default; - GETTER(rtl::error, _init_error, m_init_err) - private: fptr_t m_functor = nullptr; @@ -73,7 +75,7 @@ namespace rtl m_init_err = p_err; } - template + template friend struct detail::InitMethodHop; static_assert(!std::is_const_v, "rtl::const_method<...>: 'record_t' must not be specified as 'const'."); diff --git a/ReflectionTemplateLib/rtl/rtl_method_erased.h b/ReflectionTemplateLib/rtl/rtl_method_erased.h index 3b4fe697..d63f8d59 100644 --- a/ReflectionTemplateLib/rtl/rtl_method_erased.h +++ b/ReflectionTemplateLib/rtl/rtl_method_erased.h @@ -132,8 +132,13 @@ namespace rtl hopper_t m_const_hops; hopper_t m_non_const_hops; - GETTER_REF(hopper_t, _c_hops, m_const_hops) - GETTER_REF(hopper_t, _nc_hops, m_non_const_hops) + constexpr hopper_t& get_c_hops() { + return m_const_hops; + } + + constexpr hopper_t& get_nc_hops() { + return m_non_const_hops; + } template friend struct detail::InitMethodHop; diff --git a/ReflectionTemplateLib/rtl/rtl_method_erased_return.h b/ReflectionTemplateLib/rtl/rtl_method_erased_return.h index 81a55375..b9709ea0 100644 --- a/ReflectionTemplateLib/rtl/rtl_method_erased_return.h +++ b/ReflectionTemplateLib/rtl/rtl_method_erased_return.h @@ -92,8 +92,13 @@ namespace rtl hopper_t m_const_hops; hopper_t m_non_const_hops; - GETTER_REF(hopper_t, _c_hops, m_const_hops) - GETTER_REF(hopper_t, _nc_hops, m_non_const_hops) + constexpr hopper_t& get_c_hops() { + return m_const_hops; + } + + constexpr hopper_t& get_nc_hops() { + return m_non_const_hops; + } template friend struct detail::InitMethodHop; diff --git a/ReflectionTemplateLib/rtl/rtl_method_erased_target.h b/ReflectionTemplateLib/rtl/rtl_method_erased_target.h index 26f3a843..d53cba1f 100644 --- a/ReflectionTemplateLib/rtl/rtl_method_erased_target.h +++ b/ReflectionTemplateLib/rtl/rtl_method_erased_target.h @@ -131,8 +131,13 @@ namespace rtl hopper_t m_const_hops; hopper_t m_non_const_hops; - GETTER_REF(hopper_t, _c_hops, m_const_hops) - GETTER_REF(hopper_t, _nc_hops, m_non_const_hops) + constexpr hopper_t& get_c_hops() { + return m_const_hops; + } + + constexpr hopper_t& get_nc_hops() { + return m_non_const_hops; + } template friend struct detail::InitMethodHop; From 714a17325cc85e65e6b0ade9b5c7cdd3e1f39b08 Mon Sep 17 00:00:00 2001 From: neeraj31285 Date: Mon, 5 Oct 2026 20:30:48 +0530 Subject: [PATCH 2/2] minor cleanup. --- CxxTestProps/inc/AbstractClass.h | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 CxxTestProps/inc/AbstractClass.h diff --git a/CxxTestProps/inc/AbstractClass.h b/CxxTestProps/inc/AbstractClass.h deleted file mode 100644 index a7820edd..00000000 --- a/CxxTestProps/inc/AbstractClass.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -class Abstract -{ -public: - - virtual ~Abstract() = 0 { } - - void reset() { - - } - - static Abstract* create(); -}; - -class AbstractNode : public Abstract -{ -}; - -Abstract* Abstract::create() { - return new AbstractNode(); -}