Advertisement
Guest User

CS8347

a guest
Aug 21st, 2022
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. public readonly ref struct MySpanWrapper1
  2. {
  3.     public readonly Span<byte> content;
  4.  
  5.     public MySpanWrapper1(in Span<byte> buffer)
  6.     {
  7.         content = buffer;
  8.     }
  9.  
  10.     public MySpanWrapper1 Copy()
  11.     {
  12.         return new MySpanWrapper1(content);
  13.     }
  14. }
  15.  
  16.  
  17. public readonly ref struct MySpanWrapper2
  18. {
  19.     public readonly Span<byte> content;
  20.  
  21.     public MySpanWrapper2(Span<byte> buffer)
  22.     {
  23.         content = buffer;
  24.     }
  25.  
  26.     public MySpanWrapper2 Copy()
  27.     {
  28.         return new MySpanWrapper2(content);
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement