This commit is contained in:
ouczbs 2024-10-23 20:51:29 +08:00
parent 28ebd58bc0
commit 9806bbc67b
2 changed files with 3 additions and 2 deletions

View File

@ -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<FieldMetaImplData> FieldList = new List<FieldMetaImplData>();
}
@ -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));

View File

@ -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{