public static T TryPop <T>(this ITryPop <T> c, T defaultValue) { bool isEmpty; T value = c.TryPop(out isEmpty); return(isEmpty ? defaultValue : value); }
public static bool TryPop <T>(this ITryPop <T> c, out T value) { bool isEmpty; value = c.TryPop(out isEmpty); return(!isEmpty); }
public static T Pop <T>(this ITryPop <T> c) { bool isEmpty; T next = c.TryPop(out isEmpty); if (isEmpty) { throw new EmptySequenceException("The {0} is empty".Localized(MemoizedTypeName.Get(c.GetType()))); } return(next); }
public static T TryPop <T>(this ITryPop <T> c) { bool isEmpty; return(c.TryPop(out isEmpty)); }