using System;
using System.Collections.Generic;
namespace UniRx
{
public static partial class DisposableExtensions
{
/// Add disposable(self) to CompositeDisposable(or other ICollection). Return value is self disposable.
public static T AddTo(this T disposable, ICollection container)
where T : IDisposable
{
if (disposable == null) throw new ArgumentNullException("disposable");
if (container == null) throw new ArgumentNullException("container");
container.Add(disposable);
return disposable;
}
}
}