You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an arbitrary example but let's say I have a funciton
voidSomeClass::SetTarget(AActor* InTarget){
Target = InTarget;
...
AActor* localTarget = Target; // is local the right prefix for this?
...
}
Traditionally in previous teams I've always named the member variable as m_target in this case but I know that's not recommended. I have seen some instances of Epic using My as a prefix but that sometimes doesn't look right either.
I could rename the function parameter to be (AActor* InTarget)
Then what about if I need a local function variable do I name that localTarget?
I've yet to find consistent unreal specific guidelines for dealing with these 3 scopes since I thought I read that using this-> isn't typically recommended?
The text was updated successfully, but these errors were encountered:
Shadowed variables are not allowed. C++ allows variables to be shadowed from an outer scope, but this makes usage ambiguous to a reader. For example, there are three usable Count variables in this member function:
This is an arbitrary example but let's say I have a funciton
Traditionally in previous teams I've always named the member variable as m_target in this case but I know that's not recommended. I have seen some instances of Epic using
My
as a prefix but that sometimes doesn't look right either.I could rename the function parameter to be (AActor* InTarget)
Then what about if I need a local function variable do I name that localTarget?
I've yet to find consistent unreal specific guidelines for dealing with these 3 scopes since I thought I read that using
this->
isn't typically recommended?The text was updated successfully, but these errors were encountered: