c++ - Compiler not flagging incorrect return value for HRESULT -


I'm just trying to diagnose the way for a very long time, code Why in the following snippet? ProcessAvent () Method False Values ​​I aInvokeEventHandler :

  HRESULT CEVET_Manager :: Process (event anEvent ) {Return (m_pPool-> GetFsm () -> Process Event (anEvent), Incorrect); } // Definition of Process () HRESULT Process (Const event and An Event, Bull an InvokeAventHandler = True);  

Whenever I broke into ProcessEvent () method, anInvokeEventHandler should always be true I have been passed in false .

It took a work problem that I get to indicate that the incorrect value interiors returns the brackets on the line, like:

  return m_pPool-> GetFsm () - & gt; Process (one avenue, wrong); // Correct code  

As soon as I saw it, I fired myself. Obviously it was difficult to clarify because the original signer used the reddish outer bracket on the back line.

My question is, the compiler chose this for me?

My method is returning a HRESULT , yet at the top of the original code, I am clearly referring to the composite values ​​in parentheses, that is:

< Pre> (HRESULT, bool)

This is acceptable in C / C ++ standards, and if so, what purpose would it be in allowing this? Or is it a bug in the compiler?

You are suffering from a coma operator, which evaluates and discards the value of the operand left hand, And then evaluates the operation of your right hand as the value of the expression.

Also, the default value for the process event logic is why your one-logic call is acceptable.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -