mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
parent
9aab19f349
commit
f68f92776b
6 changed files with 24 additions and 12 deletions
|
@ -157,6 +157,18 @@ namespace epee
|
|||
pod_val = CONVERT_POD(pod_val);
|
||||
}
|
||||
|
||||
template<>
|
||||
void throwable_buffer_reader::read<bool>(bool& pod_val)
|
||||
{
|
||||
RECURSION_LIMITATION();
|
||||
static_assert(std::is_pod<bool>::value, "POD type expected");
|
||||
static_assert(sizeof(bool) == sizeof(uint8_t), "We really shouldn't use bool directly in serialization code. Replace it with uint8_t if this assert triggers!");
|
||||
uint8_t t;
|
||||
read(&t, sizeof(t));
|
||||
CHECK_AND_ASSERT_THROW_MES(t <= 1, "Invalid bool value " << t);
|
||||
pod_val = (t != 0);
|
||||
}
|
||||
|
||||
template<class t_type>
|
||||
t_type throwable_buffer_reader::read()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue