Skip to content

Commit d03b980

Browse files
committed
Added ValueTypeWrapper.
1 parent 644a57a commit d03b980

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Util/ValueTypeWrapper.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace ReClassNET.Util
2+
{
3+
/// <summary>A wrapper for non reference types.</summary>
4+
/// <typeparam name="T">Generic type parameter.</typeparam>
5+
public class ValueTypeWrapper<T> where T : struct
6+
{
7+
public ValueTypeWrapper(T value)
8+
{
9+
Value = value;
10+
}
11+
12+
public T Value { get; set; }
13+
14+
public static implicit operator ValueTypeWrapper<T>(T value)
15+
{
16+
return new ValueTypeWrapper<T>(value);
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)