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: <a href="http://www.codeguru.com/cpp/tic/tic0125.shtml">http://www.codeguru.com/cpp/tic/tic0125.shtml</a> Read that chapter, check out the source code, you will feel much better.-fel~Operator overloading is a Very Cool Thing~