```cs interface INonCopyable { } interface IMovable : INonCopyable { // void OnMoved(); ? } static class MoveExtensions { public static T Move<T>(ref this T x) where T : struct, IMovable { // needs interlocked exchange? var t = x; // x.OnMoved(); ? x = default; return t; } } ``` - allow `var y = x.Move();` - disallow to use `x` after `Move` This is not so hard for local variables and parameters but fields.
var y = x.Move();xafterMoveThis is not so hard for local variables and parameters but fields.