Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Find References creation/contr hits and emplace

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
Alek86 Posted - Dec 05 2017 : 3:57:47 PM
Hi

If I have code like this:

#include <vector>
using namespace std;
struct S1 {};
int main()
{
	S1 s1;
	vector<S1> v;
	v.emplace_back();
}


and I search where S1 instance is created/constructed, it would be great if C++11 emplace... functions will be also shown, because they do construct instances of corresponding classes.
Currently I don't see emplace_back in the Find References Results window (I tried to attach what I see)




Visual Assist info: VA_X.dll file version 10.9.2223.0 built 2017.06.22
5   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Dec 06 2017 : 4:29:19 PM
quote:
Where can I read about this setting?

https://wholetomato.fogbugz.com/f/page?W792

quote:
Maybe I can use it for emplace functions too?

No, unfortunately, it will not help, since your class/struct name (S1 in your example) cannot be found on the line where you are calling emplace_back(). In other words, we would need to search for the object, not the class name. This is what case=112782 is all about, but that will not happen overnight. It would be a bigger development.
Alek86 Posted - Dec 06 2017 : 08:32:27 AM
Thank you.
Where can I read about this setting? Maybe I can use it for emplace functions too?
accord Posted - Dec 06 2017 : 07:32:23 AM
The problem with this case is that we textually search for the reference (the string of "S1" in this case) and then we analyze the context to decide if it is relevant to include and if it is, then we decide which filter category to put it in. Creations is such a filter category.

For this to be implemented, we would need to run a find references for every declaration which can be quite slow. Although it's not easy, I don't see why can't we implement this at some point. I've opened a feature request to see what other developers make of it:

case=112782

Regarding template classes you wrote yourself, we have a registry settings for that. You can put custom template function names there which VA will consider a creation.
Alek86 Posted - Dec 05 2017 : 4:39:33 PM
Maybe.
My concern is:
In case of
v.push_back(S1());
I would see the construction in Find results.
But if I optimize it (VA is now suggesting this optimization), the construction disappears from search results.

I understand, that in push_back you show only the temp class construction, not the copy construction. But from user experience using emplace... becomes a bit of regression.
feline Posted - Dec 05 2017 : 4:04:40 PM
My concern with this logic is how far does it extend? What about a template class you wrote yourself, which does the same thing, but with the method "AddNewToTheEnd()" ? Would you then expect VA to also pick this up?

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