Beispiel #1
0
        /// <summary>Create a new list tuple by merging the items of three tuples together</summary>
        public ListTuple(ListTuple <T> a, ListTuple <T> b, ListTuple <T> c)
        {
            Contract.NotNull(a);
            Contract.NotNull(b);
            Contract.NotNull(c);

            int nA = a.Count;
            int nB = b.Count;
            int nC = c.Count;

            var items = new T[checked (nA + nB + nC)];

            if (nA > 0)
            {
                a.CopyTo(items, 0);
            }
            if (nB > 0)
            {
                b.CopyTo(items, nA);
            }
            if (nC > 0)
            {
                c.CopyTo(items, nA + nB);
            }

            m_items = items;
        }
Beispiel #2
0
        /// <summary>Create a new list tuple by merging the items of two tuples together</summary>
        public ListTuple(ListTuple <T> a, ListTuple <T> b)
        {
            Contract.NotNull(a);
            Contract.NotNull(b);

            int nA = a.Count;
            int nB = b.Count;

            var items = new T[checked (nA + nB)];

            if (nA > 0)
            {
                a.CopyTo(items, 0);
            }
            if (nB > 0)
            {
                b.CopyTo(items, nA);
            }
            m_items = items.AsMemory();
        }