Created
November 12, 2013 23:55
-
-
Save zah/7440962 to your computer and use it in GitHub Desktop.
typedesc iterator
This file contains hidden or 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 typetraits | |
iterator foo(x: int, T: typedesc): int = | |
echo x, T.name | |
yield 10 | |
for x in foo(10, int): | |
echo x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another version that also works: