I understand that it is used for serialization and deserialization of a struct but why does anybody want to serialize/deserialize the struct? What's the use case?

up vote 1 down vote accepted

EOSLIB_SERIAlIZE is a DataStream Seralizater , if you want to deep dive into what it does you should go to contracts/eosiolib/serialize.hpp in your EOS directory. It basically gives the struct extra operators for the serialization and deserialization of data to and from the multi_index database.

if you go deep inside this you will found that it was using BOOST_PP_SEQ_FOR_EACH macro. If you want to know more on Boost preprocessor + enums that is what exactly happening here you should go here and personally I would suggest you to go explore more about enums in c++.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.