[Quickfix-developers] FIX42::QuoteRequest operator=()
Brought to you by:
orenmnero
From: Brendan B. B. <br...@ka...> - 2004-08-26 22:56:10
|
Hi, Using VC++ 6.0, the following copy of a FIX42::QuoteRequest causes a stack overflow as FIX42::Message::operator=() recursively calls FIX42::Message::operator=() instead of calling up to FIX::Message::operator=() e.g: FIX42::QuoteRequest::operator=() --> FIX42::Message::operator=() --> FIX::Message::operator=() --> FIX::FieldMap::operator=() as is the case on Linux (Fedora C1, gcc 3.4.0). FIX::Message msg_1; FIX::Message msg_2; FIX42::QuoteRequest quoteRequest42_1; FIX42::QuoteRequest quoteRequest42_2; msg_1 = msg_2; // ok quoteRequest42_1 = quoteRequest42_2; // stack overflow I tried implementing a FIX42::Message &FIX42::Message::operator =(const FIX42::Message &rhs): Message &operator =(const Message &p_message) { if (this == &p_message) { return(*this); } /* end if */ *((FIX::Message *) this) = p_message; return(*this); } This seems to address the copy problem and work on Win & Lnx. This is probably a VC++ 6.0 bug - I've also seen it when copying FIX41::NewOrderSingle as well. TIA for any insights / comments. Regards, Brendan |