tgenericprop.nim 307 B

12345678910111213
  1. type
  2. TProperty[T] = object of TObject
  3. getProc: proc(property: TProperty[T]): T {.nimcall.}
  4. setProc: proc(property: TProperty[T], value: T) {.nimcall.}
  5. value: T
  6. proc newProperty[T](value: TObject): TProperty[T] =
  7. result.getProc = proc (property: TProperty[T]) =
  8. return property.value