configy.FieldRef

Implement a template to keep track of a field references

Passing field references by alias template parameter creates many problem, and is extremely cumbersome to work with. Instead, we pass an instance of a FieldRef around, which also contains structured information.

Members

Aliases

FieldsName
alias FieldsName(T) = staticMap!(FieldRefToName, FieldRefTuple!T)
Patterns
alias Patterns(T) = staticMap!(FieldRefToName, Filter!(IsPattern, FieldRefTuple!T))

Dub extension

Enums

IsPattern
eponymoustemplate IsPattern(alias FR)

Dub extension

Templates

FieldRef
template FieldRef(alias T, string name, bool forceOptional = false)

A reference to a field in a struct

FieldRefTuple
template FieldRefTuple(T)

Get a tuple of FieldRef from a struct

NestedFieldRef
template NestedFieldRef(ElemT, alias FR)

A pseudo FieldRef for nested types (e.g. arrays / associative arrays)

StructFieldRef
template StructFieldRef(ST, string DefaultName = null)

A pseudo FieldRef used for structs which are not fields (top-level)

Meta

License

MIT License. See LICENSE for details.