![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2008
Posts: 6
Rep Power: 0
![]() |
operator overloading
i was wondering about the array subscript operator in particular("[]"), is there a limit to how many arguments can be passed through it?
|
|
|
|
|
|
#2 | |
|
Unknown
Join Date: Apr 2008
Location: unknown
Posts: 60
Rep Power: 1
![]() |
Re: operator overloading
Quote:
T operator [] (int i) const; i think it can only be overloaded with one argument
__________________
------------------------------------------------------------------------- I thought what I'd Do was, I'd pretend to be one of those deaf mutes ------------------------------------------------------------------------ Last edited by JD-Salinger; May 9th, 2008 at 12:09 AM. Reason: wrong answer |
|
|
|
|
|
|
#3 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,198
Rep Power: 5
![]() |
Re: operator overloading
The standard states that operator[] is a non-static member that accepts exactly one argument.
operator() is a non-static member that accepts an arbitrary number of parameters. ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|