Skip to content

Instantly share code, notes, and snippets.

@cblp
Created June 11, 2017 11:17
Show Gist options
  • Save cblp/3098261b8d35f5bb92696baf7007fcc7 to your computer and use it in GitHub Desktop.
Save cblp/3098261b8d35f5bb92696baf7007fcc7 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
struct Point {
double x, y;
};
string to_string(Point p) {
return string("Point{") + to_string(p.x) + ", " + to_string(p.y) + "}";
}
int main() {
Point origin{0, 0};
cout << "origin is " << to_string(origin) << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment