Created
July 22, 2015 22:44
-
-
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.
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
#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