title: Complexity of Exceptions
body: <p>I am playing around with C++ code in my spare time, working on putting together a library that could be used somewhat generically for building RPG type games.  Mostly it is focusing on the underlying data structures and functions.  I am still a long ways off from working with graphics.</p>
  
  <p>My question is this:  How complicated should exceptions  be.  I have a basic exception that looks like this:</p>
  
  <p>Header:</p>
  
  <pre><code>#include &lt;iostream&gt;
  class Exception
  {
  protected:
     std::string messageM;
  public:
     Exception() throw();
     Exception(std::string message) throw();
     Exception(std::string file, int line) throw();
     Exceptoin(Exception &amp; exception) throw();
     virtual ~Exception();
  
     virtual std::string getMessage(void) throw();
     virtual void setMessage(std::string message) throw();
  };
  </code></pre>
  
  <p>The constructors are mostly just a bunch of "messageM = message" and that sort of thing.</p>
  
  <p>Exception(std::string, int) uses stringstream to convert the number to a string.</p>
  
  <p>Is this too complex?</p>
  
  <p>I want the average exception call to be something along the lines of:</p>
  
  <pre><code>Exception exception("Message Here");
  throw exception;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Exceptoin exception(__FILE__, __LINE__);
  throw exception;
  </code></pre>
  
  <p>Also, on a related note, does C++ allow you to create the exception and throw it at the same time.  Things along the lines of  <code>throw(Exception exception("My Message"));</code> seem to give me errors.</p>
  
  <p>^_^ Thanks.</p>