Subscript Operator
From: Steve (steverigg_at_hotmail.com)
Date: 04/30/04
- Next message: Leor Zolman: "Re: Problem with overloading function templates"
- Previous message: Jeff Schwab: "Re: Char Array. (Newbie)"
- Next in thread: Leor Zolman: "Re: Subscript Operator"
- Reply: Leor Zolman: "Re: Subscript Operator"
- Reply: Nils Schneider: "Re: Subscript Operator"
- Reply: John Harrison: "Re: Subscript Operator"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Apr 2004 16:36:21 +0100
Hi, I hope someone can help.
I have a class called cField, and another class called cFieldList.
cFieldList contains a std::vector of cFields called myvec
I've overloaded the subscript operator for cFieldList as so:
cField& operator[](int pos) { return myvec[pos]; }
however, when I compile the following code, I get an error:
cField f = MyFieldList[1]; // this an example, assume the objects exists
correctly
The compiler returns - Could not find a match for 'cField::operator
=(cFieldList)'
Anybody any ideas what I'm doing wrong?
Thanks in advance,
Steve.
- Next message: Leor Zolman: "Re: Problem with overloading function templates"
- Previous message: Jeff Schwab: "Re: Char Array. (Newbie)"
- Next in thread: Leor Zolman: "Re: Subscript Operator"
- Reply: Leor Zolman: "Re: Subscript Operator"
- Reply: Nils Schneider: "Re: Subscript Operator"
- Reply: John Harrison: "Re: Subscript Operator"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|