You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is, each struct has a lot of fields, and every field in the struct is @lazy.
For each struct, I want to have a zero-argument constructor that passes uninit to each field. I.e.
functionMyStruct()
returnMyStruct(
uninit,
uninit,
uninit,
...
uninit,
)
end
It's kind of tedious to write out all of these constructors by hand. Would it be possible for LazilyInitializedFields to auto-generate these zero-argument constructors for me?
The text was updated successfully, but these errors were encountered:
DilumAluthge
changed the title
Auto-generate zero-argument constructors when all fields are @lazy
[FR] Auto-generate zero-argument constructors when all fields are @lazyMay 25, 2021
Or, alternatively, is there a way that I could combine LazilyInitializedFields.@lazy with Base.@kwdef so that I can automatically get a kwarg constructor?
I have multiple structs that look like this:
That is, each struct has a lot of fields, and every field in the struct is
@lazy
.For each struct, I want to have a zero-argument constructor that passes
uninit
to each field. I.e.It's kind of tedious to write out all of these constructors by hand. Would it be possible for LazilyInitializedFields to auto-generate these zero-argument constructors for me?
The text was updated successfully, but these errors were encountered: