summary refs log tree commit diff
path: root/crypto/src/util/collections/EnumerableProxy.cs
blob: 1d97b8f2216d05f442e51dac333e0dfece702b8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;

namespace Org.BouncyCastle.Utilities.Collections
{
	internal sealed class EnumerableProxy<T>
		: IEnumerable<T>
	{
		private readonly IEnumerable<T> m_target;

		internal EnumerableProxy(IEnumerable<T> target)
		{
			if (target == null)
				throw new ArgumentNullException(nameof(target));

			m_target = target;
		}

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return m_target.GetEnumerator();
		}

		public IEnumerator<T> GetEnumerator()
		{
			return m_target.GetEnumerator();
		}
	}
}