Topic: Is Sun or the ANSI committee confused?
Author: mat@mole-end.matawan.nj.us
Date: Fri, 10 Feb 1995 03:04:09 GMT Raw View
In article <JASON.95Feb5200033@phydeaux.cygnus.com>, jason@cygnus.com (Jason Merrill) writes:
> >>>>> Bob Kerns <rwk@inference.com> writes:
> > Did the ANSI comittee really forget about operator()? Or did Sun
> > misconstrue the comittee's intent here?
>
> Sun is not misconstruing the dictums of the Working Paper. I believe this
> to be an oversight. g++ allows default arguments for operator(),
> operator++ and operator--.
>
> 13.4 Overloaded operators [over.oper]
>
> 8 An operator function cannot have default arguments
> (_dcl.fct.default_).
>
> Jason
There's a trick here where operator() () is concerned. The argument
to the operator function is the _argument list_. That list may contain
default arguments.
--
(This man's opinions are his own.)
From mole-end Mark Terribile
mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
(Training and consulting in C, C++, UNIX, etc.)
Author: jason@cygnus.com (Jason Merrill)
Date: Fri, 10 Feb 1995 22:33:01 GMT Raw View
>>>>> mat <mat@mole-end.matawan.nj.us> writes:
> There's a trick here where operator() () is concerned. The argument
> to the operator function is the _argument list_. That list may contain
> default arguments.
That's an interesting interpretation. Can you give a citation that
supports it?
Jason
Author: rwk@inference.com (Bob Kerns)
Date: 5 Feb 1995 22:51:28 GMT Raw View
In switching some code to Sun's SPARCompiler C++ 4.0.1 recently,
one of the glitches was that the compiler complained about the
following construct:
class Foo {
public:
void operator()(int a, int b = 0);
};
In Sun's documentation is the claim that ANSI's Draft Working Paper
disallows all default values for operators. It then goes on to claim
that this will be no inconvenience for anyone because "the only way to
do this is by explicitly calling the operator using the 'operator'
keyword".
Now, I don't have a copy of the DWP, so I can't check for myself.
But I don't know whether to believe Sun, or if they just misread.
Did the ANSI comittee really forget about operator()? Or did Sun
misconstrue the comittee's intent here?
To whom do I complain?
Author: jason@cygnus.com (Jason Merrill)
Date: Mon, 6 Feb 1995 04:00:33 GMT Raw View
>>>>> Bob Kerns <rwk@inference.com> writes:
> Did the ANSI comittee really forget about operator()? Or did Sun
> misconstrue the comittee's intent here?
Sun is not misconstruing the dictums of the Working Paper. I believe this
to be an oversight. g++ allows default arguments for operator(),
operator++ and operator--.
13.4 Overloaded operators [over.oper]
8 An operator function cannot have default arguments
(_dcl.fct.default_).
Jason