fork download
  1. T∗ space;
  2.  
  3. template<typename T>
  4. void Vector<T>::push_back(const T& t)
  5. {
  6. if (capacity()<size()+1) // make sure we have space for t
  7. reserve(size()==0?8:2∗size()); // double the capacity
  8. new(space){t}; // initialize *space to t
  9. ++space;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:2: error: stray ‘\342’ in program
 T∗ space;
  ^
prog.cpp:1:3: error: stray ‘\210’ in program
 T∗ space;
   ^
prog.cpp:1:4: error: stray ‘\227’ in program
 T∗ space;
    ^
prog.cpp:7:22: error: stray ‘\342’ in program
 reserve(size()==0?8:2∗size()); // double the capacity
                      ^
prog.cpp:7:23: error: stray ‘\210’ in program
 reserve(size()==0?8:2∗size()); // double the capacity
                       ^
prog.cpp:7:24: error: stray ‘\227’ in program
 reserve(size()==0?8:2∗size()); // double the capacity
                        ^
prog.cpp:1:1: error: ‘T’ does not name a type
 T∗ space;
 ^
prog.cpp:4:12: error: expected initializer before ‘<’ token
 void Vector<T>::push_back(const T& t)
            ^
stdout
Standard output is empty