View Single Post
  #2 (permalink)  
Old 02-28-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
We have ice_throw() in order to be able to store exceptions, and throw them later.

For example, sometimes you want to have a thread that sends requests in the background (a "call queue"). Any exceptions from sending such requests are stored and thrown when the main thread tries to add another request to the call queue.

The code you are referring to is this:

NotRegisteredException ex(__FILE__, __LINE__);
ex.kindOfObject = "user exception factory";
ex.id = id;
throw ex;

I don't see anything wrong with this code. An explicit copy constructor for NotRegisteredException is not necessary, because the constructor that the C++ compiler must create by default is perfectly ok for this.
Reply With Quote