Use const char* version of msgpack::unpack_error to avoid std::string memory allocation when usr C++11 compiler.

See http://www.cplusplus.com/reference/stdexcept/runtime_error/?kw=runtime_error
This commit is contained in:
Takatoshi Kondo 2014-08-03 17:04:46 +09:00
parent b27c87c9ed
commit e4d32b176e

View File

@ -727,8 +727,13 @@ private:
struct unpack_error : public std::runtime_error { struct unpack_error : public std::runtime_error {
#if defined(MSGPACK_USE_CPP03)
unpack_error(const std::string& msg) : unpack_error(const std::string& msg) :
std::runtime_error(msg) { } std::runtime_error(msg) { }
#else
unpack_error(const char* msg) :
std::runtime_error(msg) { }
#endif
}; };