Skip to content

Instantly share code, notes, and snippets.

@Varriount
Created November 7, 2013 18:37
Show Gist options
  • Save Varriount/7359636 to your computer and use it in GitHub Desktop.
Save Varriount/7359636 to your computer and use it in GitHub Desktop.
Example of when a generic type for a procedure must be specified
import queues
when defined(isMainModule):
var x = initQueue[float](4)
add[float](x, 20) # Must be specified, else the compiler doesn't know if 20 is an int or a float
echo(x)
@fowlmouth
Copy link

add(x, 20)
works fine here..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment