diff --git a/src/refl/GenMetaImpl.cs b/src/refl/GenMetaImpl.cs index 64fce8f..2a148bb 100644 --- a/src/refl/GenMetaImpl.cs +++ b/src/refl/GenMetaImpl.cs @@ -28,7 +28,7 @@ namespace refl public int MetaType { get; set; } = 0; public int MemberCount { get; set; } = 0; public int CtorCount { get; set; } = 0; - + public int LastAttrIndex { get; set; } = 0; public List FieldList = new List(); } @@ -63,6 +63,7 @@ namespace refl { data.FieldList.Add(new FieldMetaImplData(field, 1)); } + data.LastAttrIndex = data.FieldList.Count; foreach (var field in pair.Value.CtorList) { data.FieldList.Add(new FieldMetaImplData(field, 2)); diff --git a/src/refl/template/meta_impl.liquid b/src/refl/template/meta_impl.liquid index 1577660..76c42dd 100644 --- a/src/refl/template/meta_impl.liquid +++ b/src/refl/template/meta_impl.liquid @@ -4,7 +4,7 @@ namespace gen{ consteval static int MemberCount() { return {{MemberCount}}; }; consteval static int CtorCount() { return {{CtorCount}}; }; consteval static auto Fields(){ - return std::make_tuple({% for field in FieldList %}FProperty(&T::{{field.Name}},"{{field.Name}}"){% unless forloop.last %}, {% endunless %}{% endfor %}); + return std::make_tuple({% for field in FieldList limit:LastAttrIndex%}{%- if field.Type == 1 %}FProperty(&T::{{field.Name}},"{{field.Name}}"){% unless forloop.last %}, {% endunless %}{%- endif %}{% endfor %}); } static auto MakeFields() { return std::array{