<span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><p style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> Hi,</p><p style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> By default in Boost.Serialization, enum types are serialized as a 32-bit integer. But I need to serialize some enum types as different width integer. I've tried to specialize the boost::serialization::serialize method, but it seems it doesn't work for enums.</p> <p style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> Here is my attempt:</p><p style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <br></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> </p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">#include <iostream></span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">#include <boost/archive/binary_oarchive.hpp></span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">#include <boost/asio.hpp></span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"><br></span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">enum MyEnum_t</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">{</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> HELLO, BYE</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">};</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"><br></span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">namespace boost </span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">{ </span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">namespace serialization</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">{</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">template< class Archive ></span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">void save(Archive & ar, const MyEnum_t & t, unsigned int version)</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">{</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> unsigned char c = (unsigned char) t;</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> ar & c;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">}</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">template< class Archive ></span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">void load(Archive & ar, MyEnum_t & t, unsigned int version)</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">{</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> unsigned char c;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> ar & c;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> t = (MyEnum_t) c;</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">}</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">} // namespace serialization</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">} // namespace boost</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">BOOST_SERIALIZATION_SPLIT_FREE(MyEnum_t)</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"><br></span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">int main(int argc, const char *argv[])</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">{</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> boost::asio::streambuf buf;</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> boost::archive::binary_oarchive pboa(buf); </span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> buf.consume(buf.size()); // Ignore headers</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> MyEnum_t me = HELLO;</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> pboa << me;</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> std::cout << buf.size() << std::endl; // buf.size() = 4, but I want 1</span></font></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;"> return 0;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <font class="Apple-style-span" face="Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif"><span class="Apple-style-span" style="font-size: 14px; line-height: 17px;">} </span></font></p><p></p><p style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> <br></p><p style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> Thanks in advance,</p><p style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; word-wrap: break-word; "> Andrés</p></span>-- <br>Andrés Senac González<br><a href="mailto:andres@senac.es">andres@senac.es</a>, <a href="mailto:andres.senac@um.es">andres.senac@um.es</a><br>+(34) 627550280<br>