Skip to content

Commit

Permalink
feat: implement IReadOnlySet<T> interface on .NET 6+ (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzik authored Apr 4, 2024
1 parent 318ac04 commit 842118e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Iesi.Collections/Generic/LinkedHashSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ namespace Iesi.Collections.Generic;
public class LinkedHashSet<T> : ISet<T>
#if !NET40
, IReadOnlyCollection<T>
#endif
#if NET5_0_OR_GREATER
, IReadOnlySet<T>
#endif
where T : notnull
{
Expand Down
3 changes: 3 additions & 0 deletions src/Iesi.Collections/Generic/ReadOnlySet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public sealed class ReadOnlySet<T> : ISet<T>
#if !NET40
, IReadOnlyCollection<T>
#endif
#if NET5_0_OR_GREATER
, IReadOnlySet<T>
#endif
{
const string ErrorMessage = "The set cannot be modified through this instance.";
readonly ISet<T> _basisSet;
Expand Down
3 changes: 3 additions & 0 deletions src/Iesi.Collections/Generic/SynchronizedSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public sealed class SynchronizedSet<T> : ISet<T>
#if !NET40
, IReadOnlyCollection<T>
#endif
#if NET5_0_OR_GREATER
, IReadOnlySet<T>
#endif
{
readonly ISet<T> _basisSet;
readonly object _syncRoot;
Expand Down

0 comments on commit 842118e

Please sign in to comment.