. . . "You want to overload operator =, not [], unless foo is a function.I considered going into a long-winded dissertation on operator overloading and how to do it, but reconsidered and decided instead to send you here: http://www.codeguru.com/cpp/tic/tic0125.shtml Read that chapter, check out the source code, you will feel much better.-fel~Operator overloading is a Very Cool Thing~" .