I want to have an instance of my class convert to an `int` when using the assignment operator. So I wrote this code:

```c++
struct X
{
    X() = default;
    X& operator=(int) { std::cout << "operator=(int)\n"; return *this; }
    operator int() { return 0; }
};

int main()
{
    X a, b;
    a = b;
}

```

But it does not get called. This is because it's calling the implicit copy-assignment operator which is an exact match for the argument. I want my code to call the conversion operator on `b` first and then have the `int` return value bind to `operator=()`.

Is there a syntax to tell the compiler "do not consider this function"? In other words, how do I remove a function from overload resolution?

I've tried using templates on the copy-assignment operator so I could do SFINAE but I guess that just creates another function so the non-template one is always going to be a better match.