Skip to content

Instantly share code, notes, and snippets.

@lirenlin
Created September 13, 2018 13:41
Show Gist options
  • Select an option

  • Save lirenlin/9a4ae364bb19132a553559dfa122df33 to your computer and use it in GitHub Desktop.

Select an option

Save lirenlin/9a4ae364bb19132a553559dfa122df33 to your computer and use it in GitHub Desktop.
llvm StringSwitch
Color color = StringSwitch<Color>(argv[i])
.Case("red", Red)
.Case("orange", Orange)
.Case("yellow", Yellow)
.Case("green", Green)
.Case("blue", Blue)
.Case("indigo", Indigo)
.Cases("violet", "purple", Violet)
.Default(UnknownColor);
https://groups.google.com/forum/#!topic/llvm-dev/nFRdNtIzCgI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment