C++ Error: No match for ‘operator=’

That’s because yieldCurve[i] is of type Treasury, and new Treasury(treasuries[i]); is a pointer to a Treasury object. So you have a type mismatch.

Try changing this line:

yieldCurve[i] = new Treasury(treasuries[i]);

to this:

yieldCurve[i] = Treasury(treasuries[i]);

Leave a Comment