@@ -13778,7 +13778,7 @@ SQLITE_ORM_EXPORT namespace sqlite_orm {
1377813778#ifndef SQLITE_ORM_IMPORT_STD_MODULE
1377913779#ifdef SQLITE_ORM_REFLECTION_SUPPORTED
1378013780#include <array> // std::array
13781- #include <meta> // std::meta::access_context, std::meta::nonstatic_data_members_of, std::meta::identifier_of, std::meta::annotations_of
13781+ #include <meta> // std::define_static_array, std:: meta::access_context, std::meta::nonstatic_data_members_of, std::meta::identifier_of, std::meta::annotations_of
1378213782#include <tuple> // std::tuple
1378313783#include <utility> // std::index_sequence, std::make_index_sequence
1378413784#endif
@@ -13787,17 +13787,29 @@ SQLITE_ORM_EXPORT namespace sqlite_orm {
1378713787#ifdef SQLITE_ORM_REFLECTION_SUPPORTED
1378813788namespace sqlite_orm::internal {
1378913789 /**
13790- * Reflects the non-static data members of `T` and returns them as a fixed-size array
13791- * of `std::meta::info` reflections.
13790+ * Reflects the non-static data members of `T` and its base classes
13791+ * and returns them as a fixed-size span of `std::meta::info` reflections.
1379213792 */
1379313793 template<class T>
1379413794 consteval auto extract_members() {
1379513795 constexpr auto ctx = std::meta::access_context::current();
13796- constexpr size_t N = nonstatic_data_members_of(^^T, ctx).size();
1379713796
13798- return [&ctx]<size_t... I>(std::index_sequence<I...>) consteval {
13799- return std::array<std::meta::info, N>{nonstatic_data_members_of(^^T, ctx)[I]...};
13800- }(std::make_index_sequence<N>{});
13797+ constexpr auto collect = []<class U>(this const auto& self) -> std::vector<std::meta::info> {
13798+ std::vector<std::meta::info> result;
13799+
13800+ // Recurse into direct base classes first (preserves layout order)
13801+ template for (constexpr std::meta::info base: std::define_static_array(bases_of(^^U, ctx))) {
13802+ using base_type = typename[:type_of(base):];
13803+ result.append_range(self.template operator()<base_type>());
13804+ }
13805+
13806+ // Then this class's own non-static data members
13807+ result.append_range(nonstatic_data_members_of(^^U, ctx));
13808+
13809+ return result;
13810+ };
13811+
13812+ return std::define_static_array(collect.template operator()<T>());
1380113813 }
1380213814
1380313815 /**
0 commit comments