Skip to content

Instantly share code, notes, and snippets.

@tyru
Created April 10, 2009 18:14
Show Gist options
  • Select an option

  • Save tyru/93200 to your computer and use it in GitHub Desktop.

Select an option

Save tyru/93200 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <cstdlib>
struct foreach {
foreach&
operator()(const char* s) {
std::cout << s << std::endl;
return *this;
}
};
int
main(int argc, char *argv[]) {
foreach()("Hello")("C++")("World");
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment