Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1.     internal class IntRefLambda{
  2.         #region Delegates
  3.  
  4.         public delegate int IntLambdaDelegate(int input);
  5.  
  6.         #endregion
  7.  
  8.         readonly IntRef _reference;
  9.         readonly IntLambdaDelegate _function;
  10.  
  11.         public IntRefLambda(IntRef reference, IntLambdaDelegate functionToApply){
  12.             _reference = reference;    
  13.             _function = functionToApply;
  14.         }
  15.  
  16.         public int Value{
  17.             get { return _function.Invoke(_reference.Value); }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement