Skip to content

Commit

Permalink
Merge pull request #30 from creeperlv/develop
Browse files Browse the repository at this point in the history
Add implicit conversions in Ref<T>.
  • Loading branch information
creeperlv authored Nov 28, 2023
2 parents c4538a2 + a0846b2 commit 352433f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions LibCLCC.NET/Data/Ref.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,21 @@ public Ref(T data)
{
Data = data;
}
/// <summary>
/// Auto encapsulate.
/// </summary>
/// <param name="data"></param>
public static implicit operator Ref<T>(T data)
{
return new Ref<T>(data);
}
/// <summary>
/// Get the data.
/// </summary>
/// <param name="data"></param>
public static implicit operator T(Ref<T> data)
{
return data.Data;
}
}
}
2 changes: 1 addition & 1 deletion LibCLCC.NET/LibCLCC.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>$(VersionPrefix)1.27.28.0</Version>
<Version>$(VersionPrefix)1.28.29.0</Version>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down

0 comments on commit 352433f

Please sign in to comment.