#pragma once #include #include #include #include #include #include #include #include #include #include #include template struct TMemoryTraits { enum { SimpleMemory = std::is_arithmetic::value, ContinuousMemory = SimpleMemory, OwnsMemory = SimpleMemory, }; using TElementType = T; }; template struct TMemoryTraits { enum { SimpleMemory = TMemoryTraits::SimpleMemory, ContinuousMemory = SimpleMemory, OwnsMemory = SimpleMemory, }; using TElementType = T; }; template struct TMemoryTraits> { enum { SimpleMemory = TMemoryTraits::SimpleMemory, ContinuousMemory = SimpleMemory, OwnsMemory = SimpleMemory, }; using TElementType = T; }; template struct TMemoryTraits> { enum { SimpleMemory = TMemoryTraits::SimpleMemory && TMemoryTraits::SimpleMemory, ContinuousMemory = SimpleMemory, OwnsMemory = SimpleMemory, }; using TElementType = std::pair; }; template <> struct TMemoryTraits { enum { SimpleMemory = false, ContinuousMemory = true, OwnsMemory = true, }; using TElementType = char; }; template <> struct TMemoryTraits { enum { SimpleMemory = false, ContinuousMemory = true, OwnsMemory = true, }; using TElementType = char; }; template <> struct TMemoryTraits< ::TBlob> { enum { SimpleMemory = false, ContinuousMemory = true, OwnsMemory = true, }; using TElementType = char; }; template struct TElementDependentMemoryTraits { enum { SimpleMemory = false, ContinuousMemory = TMemoryTraits::SimpleMemory, }; using TElementType = T; }; template struct TMemoryTraits>: public TElementDependentMemoryTraits { enum { OwnsMemory = TMemoryTraits::OwnsMemory }; }; template struct TMemoryTraits>: public TMemoryTraits> { }; template struct TMemoryTraits>: public TElementDependentMemoryTraits { enum { OwnsMemory = TMemoryTraits::OwnsMemory }; }; template struct TMemoryTraits>: public TElementDependentMemoryTraits { enum { OwnsMemory = TMemoryTraits::OwnsMemory }; }; template <> struct TMemoryTraits: public TElementDependentMemoryTraits { enum { OwnsMemory = true }; }; template <> struct TMemoryTraits: public TElementDependentMemoryTraits { enum { OwnsMemory = true }; }; template struct TMemoryTraits>: public TElementDependentMemoryTraits { enum { OwnsMemory = false }; }; template struct TMemoryTraits>: public TElementDependentMemoryTraits { enum { OwnsMemory = false }; }; template <> struct TMemoryTraits: public TElementDependentMemoryTraits { enum { OwnsMemory = false }; }; template <> struct TMemoryTraits: public TElementDependentMemoryTraits { enum { OwnsMemory = false }; };