Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A {
- public:
- float method1(float a) { does something with a}
- };
- class B {
- public:
- float method2(float a) { does something with a}
- float anothermethod2(float a) { does something with a}
- };
- class B {
- public:
- float method3(float a) { does something with a}
- };
- int main()
- {
- std::vector< (what do i put in here?)> MethodsToCall;
- MethodsToCall.pushback( A::method1 );
- MethodsToCall.pushback( B::method2 );
- MethodsToCall.pushback( C::method3 );
- MethodsToCall.pushback( B::anothermethod2 );
- for(F : MethodsToCall )
- {
- std::cout << F(3.5) << std::endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement