[Solved] How to chain and serialize functions by overloading the | operator
First I assume you have some basics that look like this #include <iostream> struct vec2 { double x; double y; }; std::ostream& operator<<(std::ostream& stream, vec2 v2) {return stream<<v2.x<<‘,'<<v2.y;} //real methods vec2 translate(vec2 in, double a) {return vec2{in.x+a, in.y+a};} //dummy placeholder implementations vec2 rotate(vec2 in, double a) {return vec2{in.x+1, in.y-1};} vec2 scale(vec2 in, double a) {return … Read more