/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <functional>
struct Point
{
int x, y;
Point() {}
Point(const int& x, const int& y) {}
};
Point operator+(const Point& p1, const Point& p2) { return {p1.x+p2.x, p1.y+p2.y}; }
Point p1, p2;
std::function<const Point&()> fn = []{ return p1; };
int main()
{
Point p3 = fn() + p2;
return 0;
}