fork download
  1. #include <vector>
  2. #include <list>
  3. #include <string>
  4.  
  5. template <template<typename T,typename alloc = std::allocator<T> > class Container>
  6. Container<std::string> func(const std::string& s){
  7. Container<std::string> ret;
  8. ret.push_back(s);
  9. return ret;
  10. }
  11.  
  12. int main(void){
  13. func<std::vector>("vector");
  14. func<std::list>("list");
  15. return 0;
  16. }
Success #stdin #stdout 0.02s 2812KB
stdin
Standard input is empty
stdout
Standard output is empty