using System; class Test{ public struct Ref{ public delegate int GetD(T A); public delegate void SetD(ref T trg, VT val); public struct RefIn{ public readonly GetD Get; public readonly SetD Set; public RefIn(GetD g, SetD s){ Get = g; Set = s; } } public static RefIn Wrap(GetD g, SetD s){ return new RefIn(g, s); } } struct Hoge { public int A; } public static void Main(){ Hoge trg = new Hoge(); var wr = Ref.Wrap( (Hoge t) => t.A, (ref Hoge t, int v) => t.A = v ); wr.Set(ref trg, 100); Console.Write( wr.Get(trg) ); } }