Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 std::map of struct field rename issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kram
Junior Member

Germany
16 Posts

Posted - Oct 07 2021 :  03:02:12 AM  Show Profile  Reply with Quote
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;
        }
    };
}

B00ting, please wait...

Edited by - Kram on Oct 07 2021 03:05:56 AM

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Oct 07 2021 :  08:20:35 AM  Show Profile  Reply with Quote
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?

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Oct 07 2021 :  1:51:11 PM  Show Profile  Reply with Quote
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

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Oct 08 2021 :  12:19:49 PM  Show Profile  Reply with Quote
case=146296

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000