Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!mike From: mike@taumet.com (Michael S. Ball) Newsgroups: comp.lang.c++ Subject: Re: How many arguments for operator() and operator[]? Keywords: overloading, operator, arguments Message-ID: <573@taumet.com> Date: 30 Jan 91 16:02:42 GMT References: <19587@shlump.nac.dec.com> Reply-To: mike@taumet.UUCP (Michael S. Ball) Organization: Taumetric Corporation, San Diego Lines: 21 In article <19587@shlump.nac.dec.com> heintze.fmcsse.enet.dec.com (Sieg Heintze) writes: >Could someone point me to the place in the Stroustrup and Ellis C++ Reference >manual where they define the number of arguments permitted when defining >a member function that overloads operator() or operator[]. See section 13.4.4 for function call and 13.4.5 for subscript. >(3) TURBO C++ allows two arguments for operator() and operator[]. I assume > that because it allows two, it will allow larger numbers of arguments > also. Allowing extra arguments for operator[] is a bug in Turbo C++. Have you tried to invoke such an operator? Since [] is binary I don't see how you can do it (barring "a.operator [](b,c)"). If you write a[b,c], the expression b,c is taken as a comma expression which is one operand of a binary operator. -Mike- -- Michael S. Ball mike@taumet.com TauMetric Corporation (619)697-7607