I tried wrapping it in a template but there is an issue with cointainers:
template defineOverload(value: untyped, typ: typedesc, body: untyped) =
proc change(value: var typ) =
body
template hasOverload(t: typedesc[typ]): bool = true
defineOverload(x, seq[int]):
x = @[]
type
Foo[T] = object
x: T
defineOverload(x, seq[Foo[T]]): # how?
x = @[]
Run
- How to make my library code aware of user provided overloads. planetis
- How to make my library code aware of user provided overlo... arnetheduck
- How to make my library code aware of user provided ov... thisago
- How to make my library code aware of user provide... planetis
- How to make my library code aware of user pro... planetis
