mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-15 15:16:51 +02:00
Fixed #357.
Added a conversion member function to msgpack::object. If msgpack::object is nil then returns false else returns true and sets a value.
This commit is contained in:
@@ -511,6 +511,15 @@ inline T* object::convert(T* v) const
|
||||
return v;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool object::convert_if_not_nil(T& v) const {
|
||||
if (is_nil()) {
|
||||
return false;
|
||||
}
|
||||
convert(v);
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(MSGPACK_USE_CPP03)
|
||||
|
||||
template <typename T>
|
||||
|
Reference in New Issue
Block a user