- using System.Collections.Generic;
- namespace VCommon.Collections
- {
- public class ReadOnlyHashSet<T>
- {
- private readonly HashSet<T> _underlying;
- public ReadOnlyHashSet(HashSet<T> underlying) => _underlying = underlying;
- public bool Contains(T value) => _underlying.Contains(value);
- public static implicit operator ReadOnlyHashSet<T>(HashSet<T> instance) => new ReadOnlyHashSet<T>(instance);
- }
- }
|