#include <iostream>

using namespace std;

struct Foo {
    int x = 0;    
};

void func(Foo *const x, Foo *y) {
    x->x = 42;
    // x = y; // error: assignment of read-only parameter ‘x’
}

int main() {
    Foo a;
    Foo b;
    cout << a.x << endl;
    func(&a, &b);
    cout << a.x << endl;
}