Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) sstream.h

 

sstream.h is an STL header file for stringstreams.

 

List of definitions in sstream.h (incomplete):

 

 

 

 

 

Example: ContainerToStr

 

ContainerToStr is a container and convert code snippet to convert a container to std::string.

 

#include <sstream>

template <class Container>
const std::string ContainerToStr(const Container& c, const std::string& seperator = " ")
{
  std::stringstream s;
  std::copy(c.begin(),c.end(),
    std::ostream_iterator<typename Container::value_type>(s,seperator.c_str()));
  return s.str();
}

 

 

 

 

 

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

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict