Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Function.h"
- #include <iostream>
- void HelloWorld(int iterations){
- for(int i = 0; i<iterations; i++){
- std::cout << "Hello, World!" << std::endl;
- }
- }
- class SillyHello {
- private:
- const char* name;
- public:
- SillyHello(){
- name = "Class Hello World";
- }
- void displaySelf(){
- std::cout << name << std::endl;
- }
- };
- int main(){
- Function<void, int> hello(HelloWorld);
- hello(3);
- SillyHello chickenfeet;
- Function<void> helloclass(&chickenfeet, &SillyHello::displaySelf);
- helloclass();
- Function<void> doubley = helloclass;
- doubley();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement