[aspectc-user] ac++ doesnt support "iterator->"???

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Tue Jul 25 09:46:32 CEST 2006


Hello Yan,

we successfully compiled the following code, which we derived from your 
example:

---
include <list>
#include <iostream>
using namespace std;

class CClass {
   char* getCriName() { return 0;}
};

void foo() {
   list<CClass> objectList;
   list<CClass>::iterator objectPos = objectList.begin();
   while(objectPos != objectList.end()){
     cout << "object name is: " << objectPos ->getCriName()  << endl;
     objectPos ++;
   }
}
---

It is obviously wrong that ac++ does not support operator ->. What is 
the difference between your example and our example? Which version are 
you using on which platform? Did you use any special command line 
options? Do you also use aspects or did you just compile the code 
without aspects?

- Olaf


Yan Mao wrote:
> Hi there,
> 
> i have a list of class object, and try to call their member function iterally.
> 
> for example, in my normal main function, there is code:
> list<CClass> objectList;
> objectList=........
> list<CClass>::iterator objectPos = objectList.begin();
> while(objectPos != objectList.end()){
> 	cout << "object name is: " << objectPos ->getCriName()  << endl;
> 	objectPos ++;
> }
> then i'll get the error message:
> error: left operand of `->' not pointer to class object
> 
> But if i change to
> 	cout << "object name is: " << (*objectPos).getCriName()  << endl;
> it works.
> 
> So, does it mean, ac++ doesnt support "iterator->"??? 
> 
> thanks,
> 
> Yan
> 




More information about the aspectc-user mailing list