Skip to content

Instantly share code, notes, and snippets.

@PhDP
Created July 22, 2015 22:44
Show Gist options
  • Save PhDP/6fb84d29c0a80b9c91b8 to your computer and use it in GitHub Desktop.
Save PhDP/6fb84d29c0a80b9c91b8 to your computer and use it in GitHub Desktop.
Playing with new C++ features to see if I can write a tokenizer / parser without boost.
#include <iostream>
#include <string>
#include <vector>
auto member_of(const std::vector<char> &cs) {
return [=](const char c) -> bool {
for (const char &x : cs) if (c == x) return true;
return false;
};
};
auto main(int argc, char **argv) -> int {
if (argc == 1) {
return -1;
}
auto s = std::string { argv[1] };
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment