[ create a new paste ] login | about

Link: http://codepad.org/RuXCYF6T    [ 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 vector<T>::iterator iterator;

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

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

 }

};

int main(void) {
 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
2
Line 15: error: type '__gnu_debug_def::vector<_Tp, std::allocator<_CharT> >' is not derived from type 'ns::test<T>'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: