Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 23rd, 2013  |  syntax: C++  |  size: 0.16 KB  |  views: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <sstream>
  2.  
  3. template<typename T>
  4. T getValue(const std::string& source) {
  5.   std::stringstream s(source);
  6.   T value;
  7.   s >> value;
  8.   return value;
  9. }
clone this paste RAW Paste Data