Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CONTFIND_H
- #define CONTFIND_H
- #include <string>
- #include <list>
- #include <map>
- template <typename ContainerT/*, typename ValueT = typename ContainerT::value_type*/>
- class container_finder
- {
- private:
- std::list<ContainerT*> container;
- public:
- container_finder() {
- //this.container.insert(cont);
- }
- container_finder<ContainerT>& add_container(ContainerT &toAdd) {
- container.push_back(&toAdd);
- return *this;
- }
- ContainerT* which(typename ContainerT::iterator itToFind) {
- for(typename std::list<ContainerT*>::iterator it = container.begin(); it != container.end(); it++) {
- for(typename ContainerT::iterator it2 = (*it)->begin(); it2 != (*it)->end(); it2++) {
- if(it2 == itToFind) {
- ContainerT* result = *it;
- return result;
- }
- }
- }
- return 0;
- }
- void &operator+=(container_finder<ContainerT>& cf, ) {
- }
- };
- #endif // CONTFIND_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement