Is it okay to use TCircularQueue for any type?

Hello, I am wondering if there is any constraint on using TCircularQueue.
For example, TCircularQueue::Enqueue is defined as following

const uint32 CurrentTail = Tail.Load();
uint32 NewTail = Buffer.GetNextIndex(CurrentTail);

if (NewTail != Head.Load())
{
    Buffer[CurrentTail] = Element; // <- actual insertion
    Tail.Store(NewTail);

    return true;
}

return false;

Buffer is defined as TCircularBuffer which is just a thin wrapper for TArray.
Here is the implementation of TCircularBuffer ctor.

explicit TCircularBuffer(uint32 Capacity)
{
    checkSlow(Capacity > 0);
    checkSlow(Capacity <= 0xffffffffU);

    Elements.AddZeroed(FMath::RoundUpToPowerOfTwo(Capacity));
    IndexMask = Elements.Num() - 1;
}

It calls TArray::AddZeroed to claim required capacity and according to the documentation AddZeroed created elements without calling ctors.

Now my concern is that if I enqueue an object into TCircularQueue, wouldn’t that be problematic to just copy assign it to a bunch of raw memory where the ctor has not been called?

Or is there something I’ve missed?

Hello! TArray::AddZeroed is used only to keep memory for item. And in line where you add a comment (// ← actual insertion) data is copied from parameter, so copy ctor is called. As for parameter it is assumed that param value is fine

I don’t think copy ctor will be called in line 6, but operator= will be.
It seems no ctor is called for Buffer.

It seemed you are right. There is no declaration and only assignment so it will be =operator