Пример #1
0
 public StackBasedPool(Func <T> generator)
 {
     _generator = generator ?? throw new ArgumentNullException(nameof(generator));
     _stack     = new SimpleStack <T>();
     _size      = 4;
     AddObjects(_size);
 }
Пример #2
0
 internal Enumerator(SimpleStack <T> stack)
 {
     _stack          = stack;
     _index          = -2;
     _currentElement = default;
 }