mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-18 03:29:49 +02:00
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:
@@ -727,8 +727,13 @@ private:
|
||||
|
||||
|
||||
struct unpack_error : public std::runtime_error {
|
||||
#if defined(MSGPACK_USE_CPP03)
|
||||
unpack_error(const std::string& msg) :
|
||||
std::runtime_error(msg) { }
|
||||
#else
|
||||
unpack_error(const char* msg) :
|
||||
std::runtime_error(msg) { }
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user