implicit operator[] member functions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5), I have a C++ class CFoo that doesn't
define an operator[] member function and has no base classes.  But use of []
is allowed by the compiler, like this:

CFoo  foo;
CFoo  test;
test = foo[0];
foo[0] = 0;

Both assignment statements seem illegal to me but cause no errors.  I cannot
post the class itself because it contains sensitive information.  Can anyone
explain what's going on here?  Specifically, is this a compiler bug, or are
implicit operator[] member functions sometimes generated by the compiler and
under what rules?  Thanks for your attention.

John Boncek



--
View this message in context: http://gcc.1065356.n5.nabble.com/implicit-operator-member-functions-tp906236.html
Sent from the gcc - Help mailing list archive at Nabble.com.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux