Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 c++ auto keyword support?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sitnduck
Senior Member

47 Posts

Posted - Apr 13 2022 :  10:04:36 AM  Show Profile  Reply with Quote
Hi! Using UE4 with Visual Studio, it looks like "auto" keywords aren't being recognized in things like for loops, e.g.:

	TArray<Activity*> Activities;
	for (auto activity : Activities)
	{
		if (activity->)
		{
			;
		}
	}


i.e. not getting any suggestion after the "->"

I only recently started using "auto" and was wondering if this is expected or an issue. Thanks!

feline
Whole Tomato Software

United Kingdom
19061 Posts

Posted - Apr 13 2022 :  11:11:57 AM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=148053

I will see if I can find a work around, to try and get VA to understand TArray a bit better. For now, you might find setting:

VA Options -> Enhanced Listboxes -> Source of C/C++ content: Default Intellisense

assuming you have not disabled the IDE intellisense parser, which quite a few of our users do when working with Unreal Engine.

zen is the art of being at one with the two'ness
Go to Top of Page

sitnduck
Senior Member

47 Posts

Posted - Apr 13 2022 :  2:51:47 PM  Show Profile  Reply with Quote
Thank you. Regarding Intellisense, I take it you mean it SHOULD be used?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19061 Posts

Posted - Apr 14 2022 :  06:20:52 AM  Show Profile  Reply with Quote
IDE intellisense vs VA intellisense is an option in our options dialog since some situations work better with one, and other situations work better with the other. It's not something we can easily predict.

Generally VA does a better job with Unreal Engine than the IDE, and the IDE intellisense parser can be a significant overhead, given the size of Unreal Engine, which is why quite a few of our users report disabling IDE intellisense with Visual Studio. In this situation IDE intellisense understands the loop across TArray while VA doesn't, so enabling IDE intellisense will help, if you don't mind the performance impact.

I hope this makes sense and helps to explain the situation a bit better.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19061 Posts

Posted - Apr 15 2022 :  09:39:23 AM  Show Profile  Reply with Quote
I have found a work around, but it does require editing the Unreal Engine TArray header file, so if you want to try this you will need to make the same edit after updating to a new version of UE. I edited the file:

C:\Program Files\Epic Games\UE_4.27\Engine\Source\Runtime\Core\Public\Containers\Array.h

and added the code:

#ifdef VA_HELPER_CODE_DOESNT_COMPILE
    std::iterator<InElementType> begin();
#endif

it is wrapped in the #ifdef to make sure the compiler removes it, but VA will still parse it. You need to add this near the top of the class, before the actual declaration of begin(), I put it in after line 314, and then triggered a VA symbol database rebuild with:

VA Options -> Performance -> Rebuild symbol databases

so VA would see the edit, which requires an IDE restart to take effect.

zen is the art of being at one with the two'ness
Go to Top of Page

sitnduck
Senior Member

47 Posts

Posted - Apr 19 2022 :  9:32:30 PM  Show Profile  Reply with Quote
Thank you; however I'm not editing the engine right now so although it might help temporarily I'll definitely wait if you have an update coming for that one. Thanks!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19061 Posts

Posted - Apr 20 2022 :  07:27:04 AM  Show Profile  Reply with Quote
That's fair. For now enabling IDE intellisense is the best work around I can suggest.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000