mirror of
https://github.com/msgpack/msgpack-c
synced 2026-06-08 16:11:40 +00:00
cpp: msgpack_object_equal
This commit is contained in:
@@ -79,6 +79,8 @@ typedef struct msgpack_object_kv {
|
||||
|
||||
void msgpack_object_print(FILE* out, msgpack_object o);
|
||||
|
||||
bool msgpack_object_equal(const msgpack_object x, const msgpack_object y);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ struct object {
|
||||
template <typename T>
|
||||
object& operator=(const T& v);
|
||||
|
||||
operator msgpack_object();
|
||||
operator msgpack_object() const;
|
||||
|
||||
struct with_zone;
|
||||
|
||||
@@ -226,6 +226,11 @@ void operator<< (object::with_zone& o, const T& v)
|
||||
}
|
||||
|
||||
|
||||
inline bool operator==(const object x, const object y)
|
||||
{
|
||||
return msgpack_object_equal(x, y);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool operator==(const object x, const T& y)
|
||||
try {
|
||||
@@ -310,7 +315,7 @@ inline void operator<< (object& o, msgpack_object v)
|
||||
::memcpy(&o, &v, sizeof(v));
|
||||
}
|
||||
|
||||
inline object::operator msgpack_object()
|
||||
inline object::operator msgpack_object() const
|
||||
{
|
||||
// FIXME beter way?
|
||||
msgpack_object obj;
|
||||
|
||||
Reference in New Issue
Block a user