Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 std::map of struct field rename issue

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
Kram Posted - Oct 07 2021 : 03:02:12 AM
Hello,

Renaming _field from the structure definition works, but not from within the return statement.

Regards.


namespace test_1
{
    struct s
    {
        int _field;
    };

    class c
    {
        std::map<int, s> m;

        int f(int p)
        {
            const auto& i = m.find(p);

            return i == m.end() ? 0 : i->second._field;
        }
    };
}
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 08 2021 : 12:19:49 PM
case=146296
feline Posted - Oct 07 2021 : 1:51:11 PM
If you use Alt-G on "_field" you should be taken to its declaration, even though VA is a bit confused about it.

You can run Find References from there, and so long as you have turned On showing:

Display unknown/guess hits (G)

entries in the Find References Results list you should see this entry listed, just as a guess, so with a question mark icon. The problem is that VA does not properly understand the return type of the map::find() function. So now I need to have a hunt through the main STL storage classes and see how many other functions have this problem.

Thank you for reporting this, now I know about it I can work on it
feline Posted - Oct 07 2021 : 08:20:35 AM
I am seeing the same problem here and am looking into this. I think you may have found a hole in our STL support... the question is, how big a hole?

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