Created
November 7, 2013 18:37
-
-
Save Varriount/7359636 to your computer and use it in GitHub Desktop.
Example of when a generic type for a procedure must be specified
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add(x, 20)
works fine here..