Skip to content

Instantly share code, notes, and snippets.

@JossWhittle
Created March 16, 2019 00:41
Show Gist options
  • Select an option

  • Save JossWhittle/0051a158f44abedcec8726ce21467521 to your computer and use it in GitHub Desktop.

Select an option

Save JossWhittle/0051a158f44abedcec8726ce21467521 to your computer and use it in GitHub Desktop.
#include <iostream>
int main(int argc, char* argv[]) {
int i = 2;
((i == 0) ? ([]() {
std::cout << "Branch 1" << std::endl;
})() : ([]() {
std::cout << "Branch 2" << std::endl;
})());
std::cin.get();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment