コード例 #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
ファイル: Queue interfaces.cs プロジェクト: dadhi/ecsharp
        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));
        }