Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <vector>
- #include <iostream>
- struct hookentry {
- hookentry(void(*h)(), std::string n): hook(h), name(n){}
- void(*hook)();
- std::string name;
- };
- std::vector<hookentry> hooks = {
- {
- [](){
- std::cout << " Do you like this?" << std::endl;
- },
- "What am I doing here?"
- },
- {
- [](){
- std::cout << ", what the hell" << std::endl;
- },
- "goddamnit"
- }
- };
- int main(){
- for(long i=0; i<(long)hooks.size(); i++){
- std::cout << hooks[i].name;
- hooks[i].hook();
- std::cout << std::endl;
- }
- return 0;
- }
- /*
- What am I doing here? Do you like this?
- goddamnit, what the hell
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement