Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3162


Ignore:
Timestamp:
Jun 14, 2009, 11:18:43 AM (15 years ago)
Author:
rgrieder
Message:

Added support to write exception messages like the following:
int number = 8;
ThrowException(General, "number = " << number);

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pch/src/util/Exception.h

    r3149 r3162  
    3838#include "UtilPrereqs.h"
    3939
     40#include <exception>
     41#include <sstream>
    4042#include <string>
    41 #include <exception>
    42 #include <cassert>
    4343#include "Debug.h"
    4444
     
    121121
    122122#define ThrowException(type, description) \
    123     throw InternalHandleException(type##Exception(description, __LINE__, __FILE__, __FUNCTIONNAME__))
     123    throw InternalHandleException(type##Exception(static_cast<std::ostringstream&>(std::ostringstream().flush() << description).str(), __LINE__, __FILE__, __FUNCTIONNAME__))
    124124
    125125#endif /* _Exception_H__ */
Note: See TracChangeset for help on using the changeset viewer.