[ create a new paste ] login | about

Link: http://codepad.org/gcJBCFOD    [ raw code | output | fork ]

C++, pasted on Oct 18:
#include <iostream>
#include <vector>

using namespace std;

namespace ns {

 template <class T>
 class test {

  private:
   vector<T> container;

  public:
   typedef typename vector<T>::iterator iterator;

   typename vector<T>::iterator begin() {
    return container.begin();
   }

   typename vector<T>::iterator end() {
    return container.end();
   }

 };

}

int main(void) {
 ns::test<int> inters;
 
 for (ns::test<int>::iterator i = inters.begin(); i != inters.end(); i++) {
  // bla bla bla
 }

 cout << "end" << endl;
 return 0;
}


Output:
1
end


Create a new paste based on this one


Comments: