Skip to content

Instantly share code, notes, and snippets.

@gcr
Created December 26, 2013 03:52
Show Gist options
  • Select an option

  • Save gcr/8129592 to your computer and use it in GitHub Desktop.

Select an option

Save gcr/8129592 to your computer and use it in GitHub Desktop.
type GLBuffer = distinct int
proc foo(): GLBuffer =
var
a = GLBuffer(6)
b = GLBuffer(7)
c = GLBuffer(8)
return a
proc destruct(o: var GLBuffer) {.destructor.} =
echo "GOODBYE "& $int(o)
proc main() =
var x = foo()
echo int(x)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment