Author |
Topic |
|
MrJones4u
Ketchup Master
83 Posts |
Posted - Aug 13 2018 : 07:11:20 AM
|
Hello,
I often find myself wondering why I cannot simply go the the class definition of an object that has been defined by an auto, when using shared_ptrs.
In this case clicking ALT-G on the auto leads to an dead end somewhere in the stl memory include...
thanks, Michael
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Aug 13 2018 : 08:57:24 AM
|
If you try Alt-Shift-G, which should bring up:
VAssistX -> Goto Related
this should offer the type inside the pointer, as well as the pointer type its self. You are asking VA to go to the definition of the type, but the main type is the shared pointer container. As soon as more than one type is involved, you always have this question of "which type do you mean", so Goto Related just tries to list all of the types, so you can decide which one it is you want to go to. |
zen is the art of being at one with the two'ness |
|
|
MrJones4u
Ketchup Master
83 Posts |
Posted - Aug 14 2018 : 03:49:06 AM
|
Hallo,
thanks for the pointer, I was not actually aware of this option :-). Yet, while valid, this is still a really long winding way to do such a frequent operation - auto, std::shared and such are sort of here to stay for a while...
cu, Michael |
Edited by - MrJones4u on Aug 14 2018 03:55:51 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Aug 14 2018 : 06:46:19 AM
|
They are, but where do you draw the line? If we apply a different rule just for the STL containers, then anyone using Boost will still have this problem. What about template classes in general? Sometimes you want the template, and sometimes you want one of the types the template is handling. |
zen is the art of being at one with the two'ness |
|
|
MrJones4u
Ketchup Master
83 Posts |
Posted - Aug 14 2018 : 06:59:22 AM
|
..yes, my thoughts exactly - what with templates with multiple classes - a spiral decent into madness :-)
But that was why I included the picture above - what if we could click on the displayed elements e.g. when I click on the class name I get options for that classname? |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Aug 14 2018 : 08:02:37 AM
|
Isn't this what Alt-Shift-G is giving you? It should, so if it isn't then this is something that needs looking into. Basically this is exactly the sort of situation that Goto Related is designed to handle. |
zen is the art of being at one with the two'ness |
|
|
MrJones4u
Ketchup Master
83 Posts |
Posted - Aug 14 2018 : 08:10:22 AM
|
Not really, ALT-Shift-G gives me a two level menu with inconsistent, aka must read no blind fly, menu entries which may or may not contain the desired entry - whereas the normal informational pop-up generally clearly displays the desired aspects of the item I am hovering above- It also clearly displays that the code knows how the item is constructed as it is not a code copy but a (re) assembly of the type. As I can actually click into the pop.-up without it twiching it is currently "wasted real estate" :-)
cu, Michael |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Aug 14 2018 : 12:44:22 PM
|
Sometimes the tooltip is coming from the IDE, sometimes it will be coming from the IDE. So immediately this gets a bit more tricky. Next there is the problem that as soon as the tooltip stays put when you move the mouse to click on it, this will upset people who don't want to have the tooltip "stuck" on the screen in the way.
The Alt-Shift-G menu -> Types of Symbol sub-menu is designed to group the types into the hierarchy that they are using, to make it easier to understand what is holding what. A slightly more complex code sample showing this in action happens with:
std::shared_ptr<std::map<FoodData, testForwardDeclareOffered> > severalTypePtr; auto testingRelated = severalTypePtr;
|
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|