Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 c++ auto keyword support?

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
sitnduck Posted - Apr 13 2022 : 10:04:36 AM
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!
6   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Apr 20 2022 : 07:27:04 AM
That's fair. For now enabling IDE intellisense is the best work around I can suggest.
sitnduck Posted - Apr 19 2022 : 9:32:30 PM
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!
feline Posted - Apr 15 2022 : 09:39:23 AM
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.
feline Posted - Apr 14 2022 : 06:20:52 AM
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.
sitnduck Posted - Apr 13 2022 : 2:51:47 PM
Thank you. Regarding Intellisense, I take it you mean it SHOULD be used?
feline Posted - Apr 13 2022 : 11:11:57 AM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000