Download User Manual
Transcript
Compiler Use
3-97
--special-subscript-cost
Option:
--special-subscript-cost
--no-special-subscript-cost
Default:
--no-special-subscript-cost
Description:
Enable or disable a special nonstandard weighting of the conversion to the
integral operand of the [] operator in overload resolution.
This is a compatibility feature that may be useful with some existing code.
The special cost is enabled by default in cfront 3.0 mode. With this feature
enabled, the following code compiles without error:
struct A {
A();
operator int *();
int operator[](unsigned);
};
void main() {
A a;
a[0]; // Ambiguous, but allowed with this option
// operator[] is chosen
}
Example:
cpm16c
• • • • • • • •
--special-subscript-cost test.cc