if I want to declare a copy-constructor or a operator= like
X::X(const X &x);
X &X:
perator={const X &x};
x has a member std::list<AnyType>;
if I do the following:
X::X(const X &x){
std::list<AnyType>::iterator it=x.anylist.begin();
...
};
the compiler tells me:
error C2679:
binary operator '=' : No operator '=', that accepts a righthand operator
'class std::list<class AnyType,class std::allocator<class AnyType> >::const_iterator'
[COLOR=$991111]Binaerer Operator '=' : Kein Operator definiert, der einen rechtsseitigen Operator vom Typ 'class std::list<class AnyType,class std::allocator<class AnyType> >::const_iterator' akzeptiert (oder keine geeignete Konvertierung moeglich)[/color]
how can I step through a const list ?
the way I found was to copy the list and step throuug this one, but there must be other ways, isn't?
Greetings Andreas
X::X(const X &x);
X &X:
x has a member std::list<AnyType>;
if I do the following:
X::X(const X &x){
std::list<AnyType>::iterator it=x.anylist.begin();
...
};
the compiler tells me:
error C2679:
binary operator '=' : No operator '=', that accepts a righthand operator
'class std::list<class AnyType,class std::allocator<class AnyType> >::const_iterator'
[COLOR=$991111]Binaerer Operator '=' : Kein Operator definiert, der einen rechtsseitigen Operator vom Typ 'class std::list<class AnyType,class std::allocator<class AnyType> >::const_iterator' akzeptiert (oder keine geeignete Konvertierung moeglich)[/color]
how can I step through a const list ?
the way I found was to copy the list and step throuug this one, but there must be other ways, isn't?
Greetings Andreas