Pointer-type class/struct array (C-style) header declaration

In 4.7 everything was fine, or maybe it started happening because I included this .h into another .h, but there is now problem with unreal .h parser.
It’s forces me to use “class AType * name” instead of “AType * name”. Sometimes it’s okay, because this pointer points on single element, but when I need pointer to array of elements it may be messy. I’am scared of garbage collector, because it thinks, that it is pointer to one element, when there huge array after it.
Is it safe to use “struct myStructType * name”, “class myClassType * name” etc as pointers to arrays?
If not, how can I do it without TArray? (due to perfomance considerations)

P.S. I’am using “demanded” declaration right now, but i’am scared of bugs, garbage and crashes. It works fine by the way, but who knows…

  1. that’s called forward declaration, and shouldn’t cause a problem. you just have to use the word “Class” or “Struct” before the first time you use that foreign type in that file, and every time you want to use that type after that, you can leave out the Class or Struct keyword.

  2. just use TArray. it performs great. premature optimization is the root of all evil.

TArray is new type for me, I don’t know how actually it works, possibly it uses internal memory pool, so it can be faster than new operator, but I have a habit of using pointers - using raw memory is easier for me.
Thanks for answer :slight_smile:
It is not actually premature optimization, just i already know what i need, it my common coding.