mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-16 18:56:54 +02:00
Fixed #399
If MSGPACK_DISABLE_LEGACY_CONVERT is defined, msgpack::object::convert(T*) is removed. Added MSGPACK_DISABLE_LEGACY_CONVERT to build system and documents. Please define MSGPACK_DISABLE_LEGACY_CONVERT and update your code as follows: Replace int i; obj.convert(&i); // Removed pointer version with int i; obj.convert(i); // Reference version
This commit is contained in:
@@ -44,7 +44,7 @@ int main(void)
|
||||
msgpack::unpack(result, sbuf.str().data(), sbuf.str().size());
|
||||
msgpack::object obj = result.get();
|
||||
|
||||
obj.convert(&nc);
|
||||
obj.convert(nc);
|
||||
|
||||
std::cout << obj << " value=" << nc.value << " flag=" << nc.flag << std::endl;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ int main(void)
|
||||
msgpack::unpack(result, sbuf.str().data(), sbuf.str().size());
|
||||
msgpack::object obj = result.get();
|
||||
|
||||
obj.convert(&oc);
|
||||
obj.convert(oc);
|
||||
|
||||
std::cout << obj << " value=" << oc.value << std::endl;
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ int main(void)
|
||||
// convert msgpack::object instance into the original type.
|
||||
// if the type is mismatched, it throws msgpack::type_error exception.
|
||||
msgpack::type::tuple<int, bool, std::string> dst;
|
||||
deserialized.convert(&dst);
|
||||
deserialized.convert(dst);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ void test_map_pack_unpack() {
|
||||
std::cout << "Start converting..." << std::endl;
|
||||
{
|
||||
boost::timer::cpu_timer timer;
|
||||
unpacked.get().convert(&m2);
|
||||
unpacked.get().convert(m2);
|
||||
std::string result = timer.format();
|
||||
std::cout << result << std::endl;
|
||||
}
|
||||
|
@@ -73,7 +73,7 @@ void test_array_of_array() {
|
||||
std::cout << "Start converting..." << std::endl;
|
||||
{
|
||||
boost::timer::cpu_timer timer;
|
||||
unpacked.get().convert(&v2);
|
||||
unpacked.get().convert(v2);
|
||||
std::string result = timer.format();
|
||||
std::cout << result << std::endl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user