Update bool serialization
Make the logic clearer, to avoid issues on some compilers. Thanks to @pureland and team.
This commit is contained in:
parent
5768c6d884
commit
9763d1c194
1 changed files with 1 additions and 1 deletions
|
|
@ -307,7 +307,7 @@ namespace fc {
|
||||||
template<typename Stream> inline void pack( Stream& s, const bool& v, uint32_t _max_depth )
|
template<typename Stream> inline void pack( Stream& s, const bool& v, uint32_t _max_depth )
|
||||||
{
|
{
|
||||||
FC_ASSERT( _max_depth > 0 );
|
FC_ASSERT( _max_depth > 0 );
|
||||||
fc::raw::pack( s, uint8_t(v), _max_depth - 1 );
|
fc::raw::pack( s, v ? uint8_t(1) : uint8_t(0), _max_depth - 1 );
|
||||||
}
|
}
|
||||||
template<typename Stream> inline void unpack( Stream& s, bool& v, uint32_t _max_depth )
|
template<typename Stream> inline void unpack( Stream& s, bool& v, uint32_t _max_depth )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue