Is it possible use in-explicit constructing with operators ?
Just like in this example (which does of course not work):
class myFoo {
public:
double x, y;
myFoo(double, double);
void operator [] (myFoo);
};
int main() {
myFoo f1(0.0, 1.1);
f1[ {9.9, 10.0} ]; /// or whatever syntax to use, does not work
f1.operator[] ( {9.9, 10.0} ); /// works !
}
C++11 allows an initializer list to be passed to an overloaded
operator []
(see 13.5.5).You'd need something like
That would match your original syntax of
f1[ {9.9, 10.0} ];
.