Got a fairly roundabout error here when the compiler is trying to create the CDO for a TMap>UItemCode, uint64, FDefaultSetAllocator, TItemCodeKeyFuncs>uint64>> .
I suspect it has gone unnoticed as this Inventory model (rougue-like mass-limited list) has little overlap in genres for which UE4 has the most support.
1>c:\program files (x86)\epic games\4.14\engine\source\runtime\core\public\Containers/Set.h(156): error C2280: 'TPair::TPair(const TPair &)': attempting to reference a deleted function
1> with
1> [
1> KeyType=UItemCode,
1> ValueType=uint64
1> ]
1> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Core\Public\Containers\Map.h(80): note: see declaration of 'TPair::TPair'
1> with
1> [
1> KeyType=UItemCode,
1> ValueType=uint64
1> ]
1> c:\program files (x86)\epic games\4.14\engine\source\runtime\core\public\Containers/Set.h(484): note: see reference to function template instantiation 'TSetElement::TSetElement(const InitType &)' being compiled
1> with
1> [
1> InElementType=TPair,
1> InitType=TPair
1> ]
1> c:\program files (x86)\epic games\4.14\engine\source\runtime\core\public\Containers/Set.h(484): note: see reference to function template instantiation 'TSetElement::TSetElement(const InitType &)' being compiled
1> with
1> [
1> InElementType=TPair,
1> InitType=TPair
1> ]
1> c:\program files (x86)\epic games\4.14\engine\source\runtime\core\public\Containers/Set.h(468): note: see reference to function template instantiation 'FSetElementId TSet<TPair,KeyFuncs,SetAllocator>::Emplace(ArgsType,bool *)' being compiled
1> with
1> [
1> KeyType=UItemCode,
1> ValueType=uint64,
1> KeyFuncs=TItemCodeMapKeyFuncs,
1> SetAllocator=FDefaultSetAllocator,
1> InElementType=TPair,
1> ArgsType=const TPair &
1> ]
1> c:\program files (x86)\epic games\4.14\engine\source\runtime\core\public\Containers/Set.h(468): note: see reference to function template instantiation 'FSetElementId TSet<TPair,KeyFuncs,SetAllocator>::Emplace(ArgsType,bool *)' being compiled
1> with
1> [
1> KeyType=UItemCode,
1> ValueType=uint64,
1> KeyFuncs=TItemCodeMapKeyFuncs,
1> SetAllocator=FDefaultSetAllocator,
1> InElementType=TPair,
1> ArgsType=const TPair &
1> ]
1> c:\program files (x86)\epic games\4.14\engine\source\runtime\core\public\Containers/Set.h(468): note: while compiling class template member function 'FSetElementId TSet<TPair,KeyFuncs,SetAllocator>::Add(const InElementType &,bool *)'
1> with
1> [
1> KeyType=UItemCode,
1> ValueType=uint64,
1> KeyFuncs=TItemCodeMapKeyFuncs,
1> SetAllocator=FDefaultSetAllocator,
1> InElementType=TPair
1> ]
1> c:\program files (x86)\epic games\4.14\engine\source\runtime\core\public\Containers/Set.h(247): note: see reference to function template instantiation 'FSetElementId TSet<TPair,KeyFuncs,SetAllocator>::Add(const InElementType &,bool *)' being compiled
1> with
1> [
1> KeyType=UItemCode,
1> ValueType=uint64,
1> KeyFuncs=TItemCodeMapKeyFuncs,
1> SetAllocator=FDefaultSetAllocator,
1> InElementType=TPair
1> ]
1> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Core\Public\Containers\Map.h(683): note: see reference to class template instantiation 'TSet<TPair,KeyFuncs,SetAllocator>' being compiled
1> with
1> [
1> KeyType=UItemCode,
1> ValueType=uint64,
1> KeyFuncs=TItemCodeMapKeyFuncs,
1> SetAllocator=FDefaultSetAllocator
1> ]
1> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Core\Public\Containers\Map.h(809): note: see reference to class template instantiation 'TMapBase' being compiled
1> with
1> [
1> KeyType=UItemCode,
1> ValueType=uint64,
1> SetAllocator=FDefaultSetAllocator,
1> KeyFuncs=TItemCodeMapKeyFuncs
1> ]
1> C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Core\Public\Containers\Map.h(928): note: see reference to class template instantiation 'TSortableMapBase' being compiled
1> with
1> [
1> KeyType=UItemCode,
1> ValueType=uint64,
1> SetAllocator=FDefaultSetAllocator,
1> KeyFuncs=TItemCodeMapKeyFuncs
1> ]
1> d:\backup\unrealprojects\pluton238\source\pluton238\InventoryBase.h(38): note: see reference to class template instantiation 'TMap<UItemCode,uint64,FDefaultSetAllocator,TItemCodeMapKeyFuncs>' being compiled
I tried reducing to uint32
to check for word-length difficulties, but the same error persisted.
My TMap>UItemCode, UItem, FDefaultSetAllocator, TItemCodeMapKeyFuncs>UItem>> elsewhere is working just fine. The custom KeyFuncs is written on a copy from the documentation (consistent with the default in Map.h).