fork download
  1. #include <vector>
  2. #include <string>
  3.  
  4. template<class ReturnType>
  5. std::vector<ReturnType> split(const std::string&, const std::string&, const bool = true);
  6.  
  7. template<>
  8. std::vector<std::string> split(const std::string& s, const std::string& delim, const bool keep_empty) {
  9. // normal string vector implementation
  10. return {"1", "2", "3"};
  11. }
  12.  
  13. template<>
  14. std::vector<int> split(const std::string& s, const std::string& delim, const bool keep_empty) {
  15. // code for converting string to int
  16. return {1, 2, 3};
  17. }
  18.  
  19. int main() {}
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty