fork(1) download
  1. #include <vector>
  2. #include <memory>
  3.  
  4. template<class T, class Alloc = std::allocator<T>>
  5. std::vector<T, Alloc> make_vector(Alloc const& al = Alloc()){
  6. std::vector<T, Alloc> v(al);
  7. // ...
  8. return v;
  9. }
  10.  
  11. int main(){
  12. auto v1 = make_vector<int>();
  13. auto v2 = make_vector<int, std::allocator<int>>();
  14. std::allocator<int> al;
  15. auto v3 = make_vector<int, std::allocator<int>>(al);
  16. }
Success #stdin #stdout 0s 2824KB
stdin
Standard input is empty
stdout
Standard output is empty