Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Wt IntToWString

 

IntToWString is a convert code snippet to convert an integer to a Wt::WString.

 

#include <sstream>
#include <stdexcept>
#include <string>
#include <Wt/WString>

///IntToWString converts integer to Wt::WString
///From http://www.richelbilderbeek.nl/CppIntToWString.htm
const Wt::WString IntToWString(const int i)
{
  std::ostringstream s;
  if (!(s << i)) throw std::logic_error("IntToWString failed");
  return Wt::WString(s.str());
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict