Пример #1
0
        public static T TryPop <T>(this ITryPop <T> c, T defaultValue)
        {
            bool isEmpty;
            T    value = c.TryPop(out isEmpty);

            return(isEmpty ? defaultValue : value);
        }
Пример #2
0
        public static bool TryPop <T>(this ITryPop <T> c, out T value)
        {
            bool isEmpty;

            value = c.TryPop(out isEmpty);
            return(!isEmpty);
        }
Пример #3
0
        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);
        }
Пример #4
0
        public static T TryPop <T>(this ITryPop <T> c)
        {
            bool isEmpty;

            return(c.TryPop(out isEmpty));
        }