Last active
March 12, 2018 04:53
-
-
Save onevcat/f8321f3ebd7f8c189f09192f6f85db79 to your computer and use it in GitHub Desktop.
enumset.stencil
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
{% for enum in types.implementing.EnumSet|enum %} | |
extension {{ enum.name }} { | |
{% if not enum.hasAssociatedValues %} | |
static let all: [{{ enum.name }}] = [ | |
{% for case in enum.cases %} .{{ case.name }}{% if not forloop.last %},{% endif %} | |
{% endfor %}] | |
{% endif %} | |
static let count: Int = {{ enum.cases.count }} | |
} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment