Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. namespace gnu_np {
  2.  
  3. inline int
  4. stoi(const string& __str, size_t* __idx = 0, int __base = 10)
  5. { return __gnu_cxx::__stoa<long, int>(&std::strtol, "stoi", __str.c_str(),
  6. __idx, __base); }
  7.  
  8. inline short
  9. stos(const string& __str, size_t* __idx = 0, int __base = 10)
  10. { return __gnu_cxx::__stoa<long, short>(&std::strtol, "stos", __str.c_str(),
  11. __idx, __base); }
  12.  
  13. inline char
  14. stoc(const string& __str, size_t* __idx = 0, int __base = 10)
  15. { return __gnu_cxx::__stoa<long, char>(&std::strtol, "stoc", __str.c_str(),
  16. __idx, __base); }
  17.  
  18. inline unsigned
  19. stou(const string& __str, size_t* __idx = 0, int __base = 10)
  20. { return __gnu_cxx::__stoa<unsigned long, unsigned>(&std::strtoul, "stou", __str.c_str(),
  21. __idx, __base); }
  22.  
  23. inline unsigned short
  24. stous(const string& __str, size_t* __idx = 0, int __base = 10)
  25. { return __gnu_cxx::__stoa<unsigned long, unsigned short>(&std::strtoul, "stous", __str.c_str(),
  26. __idx, __base); }
  27.  
  28. inline unsigned char
  29. stouc(const string& __str, size_t* __idx = 0, int __base = 10)
  30. { return __gnu_cxx::__stoa<unsigned long, unsigned char>(&std::strtoul, "stouc", __str.c_str(),
  31. __idx, __base); }
  32.  
  33. } // namespace gnu_np
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement