Operator overloading

#include <iostream>
#include "math.h"
using namespace std;

class Point {
public:
    int x;
    int y;

    friend Point operator ^(Point &p, int power) {
        int x = pow(p.x, power);
        int y = pow(p.y, power);
        return {x, y};
    }
};

Point p1 = {23};
p1 = p1 ^ 3;
//p1.x is 8 and p1.y is 27

cout << p1.x << "; " << p1.y;