Warning that users of the function must handle

Posted by Hagai on Stack Overflow See other posts from Stack Overflow or by Hagai
Published on 2010-04-06T19:21:58Z Indexed on 2010/04/06 20:33 UTC
Read the original article Hit count: 182

Filed under:
|
|

I am looking for a way to set warning that the user will have to respond. In a sense I would like to use late exception mechanize that occur after the function already finished executing.and returned the wanted value.

SomeObject Foo(int input)
{
   SomeObject result;      
   // do something. oh, we need to warn the user. 

   return result;
}

void Main()
{
   SomeObject object;
   object = Foo(1); // after copy consturctor is done I would like an exception to be thrown


}

EDIT: The title to users of the function

© Stack Overflow or respective owner

Related posts about c++

Related posts about error-message