Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <list>
- #include <string>
- class A
- {
- public:
- std::string value;
- A() : value("okay") {}
- };
- class B
- {
- public:
- void func(std::string v) { std::cout << v << std::endl; }
- };
- int main()
- {
- A* pa = new A();
- B* pb = new B();
- std::list<A*> pal;
- std::list<B*> pbl;
- pal.push_back(pa);
- pbl.push_back(pb);
- std::list<A*>::iterator ia = pal.begin();
- std::list<B*>::iterator ib = pbl.begin();
- (*ib)->func((*ia)->value);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement