This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 117731 - CodeComplete list for iterators
Summary: CodeComplete list for iterators
Status: RESOLVED DUPLICATE of bug 136146
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-04 07:58 UTC by avp
Modified: 2008-06-18 13:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description avp 2007-10-04 07:58:23 UTC
I have code:
#include <vector.h>

using namespace std;
class Test{
    string Name;
};

int main(int argc, char**argv) {

    vector<Test*> myVector;
    vector<Test*>::iterator myIt;
    //
    //insert in  vector objects
    //
    // get access to vector elements
    myIt = myVector.begin();
    (*myIt)-> // <- here I call CodeComplete and I see only "No suggestions" but I expected to see "Name"
            
    return 0;
}
Comment 1 soldatov 2007-10-04 08:30:34 UTC
of course should be:
class Test{
public:
    string Name;
};
Comment 2 avp 2007-10-04 12:30:04 UTC
Even if I place "public:" keyword in class definition, I can't see members of class.
Comment 3 soldatov 2008-01-18 12:22:12 UTC
Unfortunately method refactoring breaks code if iterators are used.
First sample:
- Create Quote project
- Rename 'GetName' method in customer.h file (Refactor->Rename menu item)
- Build project
==> build fails

Other sample:
- Add such code into project:
-----------------------------------------------
#include <vector.h>
#include <iostream>

using namespace std;
class Test{
private:
    string Name;
public:
    Test(string str): Name(str) {}
    string getName() {return Name;}
};

int main(int argc, char**argv) {

    Test* t = new Test("test");
    vector<Test*> myVector;
    myVector.push_back(t);
    vector<Test*>::iterator myIt;
    myIt = myVector.begin();
    cout << ((*myIt)->getName()) << endl;
    
    return 0;
}

-----------------------------------------------
- Rename 'getName' method in 'string getName() {return Name;}' line (Refactor->Rename menu item)
- Build project
==> build fails
Comment 4 Vladimir Voskresensky 2008-06-18 13:01:45 UTC

*** This issue has been marked as a duplicate of 136146 ***