using System; namespace Implab { public struct ObjectPoolWrapper : IDisposable { readonly T m_value; readonly ObjectPool m_pool; internal ObjectPoolWrapper(T value, ObjectPool pool) { m_value = value; m_pool = pool; } public T Value { get { return m_value; } } #region IDisposable implementation public void Dispose() { m_pool.Release(m_value); } #endregion } }