Skip to content

Instantly share code, notes, and snippets.

@barcharcraz
Created March 10, 2014 03:24
Show Gist options
  • Save barcharcraz/6154649dab9033a776db to your computer and use it in GitHub Desktop.
Save barcharcraz/6154649dab9033a776db to your computer and use it in GitHub Desktop.
type TThing[T] = object
proc doThing(self: TThing): auto =
result = self.T.doTheThing()
type thingDoer = object
proc doTheThing[T: thingDoer](): int =
result = 4
when isMainModule:
var inst: TThing[thingDoer]
echo doThing(inst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment