#include<iostream>
#include<string>
#include<sstream>

template<typename ostringstream, typename T>
std::string my_to_string (T&& value)
{
  ostringstream oss;
  oss << value;
  return oss.str();
}

#define my_to_string(X) my_to_string<std::ostringstream>(X)

#include<sstream>

int main ()
{
  double d = 1.2345;
  std::string s = my_to_string(d);
  std::cout << "converted: " << s << "\n";
}
