proxy_cast_dispatch guarded a reference result with std::is_const_v<T>, where T is the deduced operand type and is therefore always a reference. A reference type is never const, so the guard never fired and a caller could ask a const proxy for a mutable reference to what it contains and get one, silently casting the constness away.
const pro::proxy<F> p = pro::make_proxy<F, int>(123);
proxy_cast<int&>(*p) = 456; // compiled, and mutated the contained value
proxy_cast_dispatchguarded a reference result withstd::is_const_v<T>, whereTis the deduced operand type and is therefore always a reference. A reference type is never const, so the guard never fired and a caller could ask a const proxy for a mutable reference to what it contains and get one, silently casting the constness away.