/// <summary> /// Combines the current value stored in this result with a new value. /// /// This operation will use the specific combine operation specified by the /// generic arguments of this class, and the constructor if a custom operator /// was defined. /// /// This operation requires write access. /// </summary> public void Write(T value) { #if ENABLE_UNITY_COLLECTIONS_CHECKS AtomicSafetyHandle.CheckWriteAndThrow(m_Safety); #endif unsafe { void *ptr = (void *)m_Buffer; T curr = UnsafeUtility.ReadArrayElementWithStride <T>(ptr, m_ThreadIndex, JobsUtility.CacheLineSize); m_Op.Combine(ref curr, ref value); UnsafeUtility.WriteArrayElementWithStride(ptr, m_ThreadIndex, JobsUtility.CacheLineSize, curr); } }
public static void blah() { Arrow <int, string> test = Op.Arr((int x) => x + 1).Combine(Op.Arr((int x) => x.ToString())); Arrow <int, string> test1 = Op.Combine(Op.Arr((int x) => x + 1), Op.Arr((int x) => x.ToString())); }