Common.h terse/archives/Traits.h tuple type_traits InputArchive.h InputArchive.h terse::impl::ValueFactory pma terse terse::impl //CopyrightEpicGames,Inc.AllRightsReserved. #pragmaonce #include"terse/archives/Traits.h" #ifdef_MSC_VER #pragmawarning(push) #pragmawarning(disable:43654987) #endif #include<tuple> #include<type_traits> #ifdef_MSC_VER #pragmawarning(pop) #endif namespacepma{ classMemoryResource; }//namespacepma namespaceterse{ namespaceimpl{ template<typenameT> structValueFactory{ staticconstexprboolNeedsAllocator=traits::needs_allocator<T>::value; staticconstexprboolNeedsMemoryResource=std::is_constructible<T,pma::MemoryResource*>::value; staticconstexprboolIsPair=traits::is_pair<T>::value; staticconstexprboolIsTuple=traits::is_tuple<T>::value; staticconstexprboolIsPrimitive=(!NeedsAllocator&&!NeedsMemoryResource&!IsPair&!IsTuple); template<classParentAllocator,boolIsPrimitive=IsPrimitive> statictypenamestd::enable_if<IsPrimitive,T>::typecreate(constParentAllocator&/*unused*/){ returnT{}; } template<classParentAllocator,boolIsPrimitive=IsPrimitive> statictypenamestd::enable_if<!IsPrimitive&&NeedsMemoryResource,T>::typecreate(constParentAllocator&alloc){ returnT{alloc.getMemoryResource()}; } template<classParentAllocator,boolIsPrimitive=IsPrimitive> statictypenamestd::enable_if<!IsPrimitive&&!NeedsMemoryResource&&NeedsAllocator,T>::typecreate( constParentAllocator&alloc){ usingTAllocator=typenamestd::allocator_traits<ParentAllocator>::templaterebind_alloc<typenameT::value_type>; returnT{TAllocator{alloc}}; } template<classParentAllocator,boolIsPrimitive=IsPrimitive> statictypenamestd::enable_if<!IsPrimitive&&!NeedsMemoryResource&&!NeedsAllocator&&IsPair,T>::typecreate( constParentAllocator&alloc){ usingK=typenameT::first_type; usingV=typenameT::second_type; returnT{ValueFactory<K>::create(alloc),ValueFactory<V>::create(alloc)}; } template<classParentAllocator,boolIsPrimitive=IsPrimitive> statictypenamestd::enable_if<!IsPrimitive&&!NeedsMemoryResource&&!NeedsAllocator&&!IsPair&&IsTuple,T>::typecreate( constParentAllocator&alloc){ usingK=typenamestd::tuple_element<0,T>::type; usingV=typenamestd::tuple_element<0,T>::type; returnT{ValueFactory<K>::create(alloc),ValueFactory<V>::create(alloc)}; } }; }//namespaceimpl }//namespaceterse