Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Lamba params autocomplete

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
swinefeaster Posted - Apr 30 2020 : 2:30:57 PM
Feature suggestion for VAX. When I use c++ lambdas, I often find myself having to manually type in the lambda function parameter list. It would be great if I could autocomplete that with tab using visual assist.

when I type:


foo ([&](


i get a tooltip showing the lambda args. i wish i could just hit Tab to get:


foo ([&](int param)

1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - May 01 2020 : 05:03:42 AM
I am still new to C++ lambdas, but this is a valid piece of code that I have worked out, while reading up on them:

std::vector<std::string> vecFileNames;

// using Lambda function to set the function called as the "for_each" iterates across
// the vector.  "currentFileName" is parameter, and it is only in scope inside
// the curly brackets defining the Lambda function body
std::for_each(vecFileNames.begin(), vecFileNames.end(), [&](const std::string ¤tFileName)
	{
		if (currentFileName.length() > 0)
		{
			// got a file name we can do something with here
		}
	});

the "[&]" means that variables defined outside of the lambda function are available inside the lambda function, but the parameter to the function, "currentFileName" in this example, does not exist outside of the function, and is created at this point. So we are creating new variable names here, so anything VA suggests is likely to be incorrect, since we have no reason to assume you are about to type a known symbol.

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