Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Trouble with pointers and iterators

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
cwdrat Posted - Mar 27 2008 : 5:33:10 PM
VA_X.dll file version 10.4.1626.1 built 2008.01.17
DevEnv.exe version 7.10.3077.0
msenv.dll version 7.10.3077.0
Font: Courier New 13(Pixels)
Comctl32.dll version 5.82.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
2 processors

Platform: Win32
Stable Includes:
C:\\Program Files\\boost\\boost_1_34_1;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\SDK\\v1.1\\include;
C:\\Program Files\\Microsoft DirectX 9.0 SDK (June 2005)\\Include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include\\prerelease;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include;

Other Includes:

Stable Source Directories:
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\crt\\src;


#include <vector>

struct Foo
{
  int member;
};

int 
main()
{
  {
    Foo *p;

    p->|member; // suggests 'member'
    (*p).|member; // suggests 'member'
    //(*p)->|member; // suggests 'member' : error C2819: type 'Foo' does not have an overloaded member 'operator ->'
    //(**p).|member; // suggests 'member' : error C2100: illegal indirection
    //(**p)->|member; // suggests 'member' : error C2100: illegal indirection
  }

  {
    Foo **pp;

    //pp->|member; // suggests 'member' : error C2227: left of '->member' must point to class/struct/union
    //(*pp).|member; // suggests 'member' : error C2228: left of '.member' must have class/struct/union type
    (*pp)->|member; // suggests 'member'
    (**pp).|member; // suggests 'member'
    //(**pp)->|member; // suggests 'member' : error C2819: type 'Foo' does not have an overloaded member 'operator ->'
  }

  {
    std::vector< Foo >::iterator it;

    it->|member; // no suggestion
    (*it).|member; // opens global symbol list, highlights '_Add'
    //(*it)->|member; // opens global symbol list, highlights '_Add' : error C2819: type 'Foo' does not have an overloaded member 'operator ->'
    //(**it).|member; // opens global symbol list, highlights '_Add' : error C2100: illegal indirection
    //(**it)->|member; // opens global symbol list, highlights '_Add' : error C2100: illegal indirection
  }

  {
    std::vector< Foo * >::iterator itp;

    //itp->|member; // no suggestion : error C2839: invalid return type 'std::vector<_Ty>::_Tptr' for overloaded 'operator ->'
    //(*itp).|member; // opens global symbol list, highlights '_Add' : error C2228: left of '.member' must have class/struct/union type
    (*itp)->|member; // opens global symbol list, highlights '_Add'
    (**itp).|member; // opens global symbol list, highlights '_Add'
    //(**itp)->|member; // opens global symbol list, highlights '_Add' : error C2819: type 'Foo' does not have an overloaded member 'operator ->'
  }
}


This is in a blank solution. VAX seems to identify malformed dereferences, and fails to recognize the iterator dereferences. I have had it correctly identify the iterators in other cases, but not in this test case. I am not using "Get content from default Intellisense." If I switch it to use default Intellisense, (**p). and (**it). incorrectly suggest 'member', but the other malformed expressions correctly offer no suggestion and the well-formed iterator expressions correctly suggest 'member'.
3   L A T E S T    R E P L I E S    (Newest First)
cwdrat Posted - Mar 28 2008 : 11:23:36 AM
Thank you for the prompt reply. I look forward to the new release.
feline Posted - Mar 27 2008 : 7:36:41 PM
Listboxes on iterators are improved in the next build. The "basic" iterator tests here should be fixed. We are hoping to post the next build in the next week or two, depending on how internal testing goes.

Some of the others, for example:

    Foo *p;

    //(**p).|member; // suggests 'member' : error C2100: illegal indirection
    //(**p)->|member; // suggests 'member' : error C2100: illegal indirection


Unless I am missing something here - which is possible - you are triggering a listbox on "meaningless" code. VA is simply doing its best, but you are unlikely to get anything overly helpful in these situations.
cwdrat Posted - Mar 27 2008 : 5:48:02 PM
I failed to include this case (which is closest to the original code in which I had a problem):


  {
    std::vector< std::vector< Foo >::iterator >::iterator ii;

    //ii->|member; // no suggestion : error C2039: 'member' : is not a member of 'std::vector<_Ty>::iterator'
    //(*ii).|member;// opens global symbol list, highlights '_Add' : error C2039: 'member' : is not a member of 'std::vector<_Ty>::iterator'
    (*ii)->|member; // opens global symbol list, highlights '_Add'
    (**ii).|member; // opens global symbol list, highlights '_Add'
    //(**ii)->|member; // global : error C2819: type 'Foo' does not have an overloaded member 'operator ->'
  }


Switching to default Intellisense, the first two cases correctly suggest members of the iterator class, the next two correctly suggest 'member', and the last case "correctly" suggests nothing.

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