# initializing a class reference member

**URL:** <https://forums.unrealengine.com/t/initializing-a-class-reference-member/457276>\
**Category:** Editor Scripting\
**Tags:** reference, tarray, constructors, unreal-engine, UE4, CPP, question\
**Created:** [October 21, 2019, 4:58pm UTC](https://forums.unrealengine.com/t/initializing-a-class-reference-member/457276 "2019-10-21T16:58:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_81655d74](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_81655d74](https://forums.unrealengine.com/u/anonymous_user_81655d74)\
**Post date:** [October 21, 2019, 4:58pm UTC](https://forums.unrealengine.com/t/initializing-a-class-reference-member/457276/1 "2019-10-21T16:58:05Z")

</div>

Simple question but not sure I’ve found a good answer after digging around. How do you initialize a class member reference variable?

**Example:**  
My ActorComponent has a TArray\<\>& member variable.

Ideally one of my constructor arguments would be a TArray\<\>& and then I would initialize the class member in the constructor. But that is not possible with constructors in Unreal.

How would I initialize the TArray\<\>& in my Actor Component?

---

<div class="post-metadata">

**Author:** ![Brannigan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brannigan](https://forums.unrealengine.com/u/Brannigan)\
**Post date:** [November 5, 2019, 7:20pm UTC](https://forums.unrealengine.com/t/initializing-a-class-reference-member/457276/2 "2019-11-05T19:20:41Z")

</div>

A little late, but I don’t think it’s possible to have reference member variables in UE4 since, as you’re already aware, we can’t modify constructors without modifying source.
