Can't copy TSharedPtr because of const incompatibility of underlying pointer
I keep getting the same compile error in multiple places when trying to copy TSharedPtr's around. That error being of the form:
One example is that I have an array of shared pointers, declared as:
And I try to pass an element of that array in to a function like so:
Where that function signature is of the form:
It seems that most of these instances have to do with having a TArray of shared pointers, and probably due to the fact that the  operator of TArray returns a reference, which I suppose is automatically const when it's an rvalue, but I'm not sure I'm supposed to be doing in this instance. Are you just not allowed to have arrays of shared pointers?
asked Sep 20 '14 at 09:41 AM in C++ Programming
Ahh, nevermind, I figured it out. It has to do with the namespace my classes resided in, and how I didn't specify the namespace for the type in the array declaration. I.e. TArray< TSharedPtr > m_mods; instead of
The difference in const-ness was a red herring.
answered Sep 20 '14 at 07:42 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here