fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. template<typename T>
  6. class Widget
  7. {
  8. public:
  9. typedef typename vector<T>::const_iterator TIter;
  10. vector<T> vec;
  11. TIter it;
  12. Widget(T x)
  13. {
  14. vec.push_back(x);
  15. it = vec.begin();
  16. };
  17. };
  18. int main()
  19. {
  20. Widget<int> w(5566);
  21. cout << *(w.it) << endl;
  22. return 0;
  23. }
Success #stdin #stdout 0.02s 2856KB
stdin
Standard input is empty
stdout
5566