Creating TMap of TSubclass and TQueue

I am having trouble while creating TMap of TSubclass of Actor and TQueue. I am doing this in a subsystem class which is responsible for adding entries in this map and on session end delete all the actors. I am familiar with that nested containers are not allowed. I have tried using USTRUCT also but still same error comes with TQueue

TMap<TSubclassOf<AActor>, TQueue<AActor*>> Pool;

How can I achieve this? Can I use std::map and std::queue ? What other approach should I take?

Hello!

  1. First of all, take a look at TMultiMap
  2. Other option - pack TQueue into struct FMyQueue

Hi Thanks for the reply I have tried method 2 but sadly it gives the same error :frowning: and for the first option Can TMultiMap ensure that records are stored in FIFO manner for a particular key. I am trying to have a constant time for it.
Error - attempting to reference a deleted function while adding in map while packing into a struct

Ok. Just about error - I often face with this when my code is trying to call copy constructor. The conclusion there - check that you are using ref and ptr variables not to copy data…

This error comes just after declaring TQueue in struct.

USTRUCT()
struct FConversion
{
GENERATED_BODY()

public:
TQueue<AActor*>act;
};=> At exact this point it reports error - compiler has generated 'FConversion::operator =' here

I haven’t added anything yet.