Exemple #1
0
		msgpack::sbuffer buffer;  // simple buffer
		
		//msgpack::pack(&buffer, src);
		for (auto f : src) {
			msgpack::pack(&buffer, f);
		}
	});
	
#if 0
	msgpack::unpacked msg;
	msgpack_object mobj;
	
	printf("Parsing... ");
	time([&]() {
		msgpack::unpack(&msg, buffer.data(), buffer.size());
		mobj = msg.get();
	});
	msgpack::object obj = mobj;
	
	printf("Copying... ");
	time([&]() {
		obj.convert(&dst);
		REQUIRE( dst[1] == 3.14f );
	});
#endif
}

#endif

#if 1
Exemple #2
0
 template<class T> MsgpackInArchive & operator&(T & o) {
     upk.next(&msg); msg.get().convert(&o);
     return *this;
 }