Fix warning: enumeration value not handled in switch

./src/json.hpp:2821:17: warning: 6 enumeration values not explicitly
      handled in switch: 'null', 'boolean', 'number_integer'... [-Wswitch-enum]
This commit is contained in:
Cristian Maglie 2017-04-15 13:26:25 +02:00
parent 14dcd918a8
commit 54c966979c
2 changed files with 22 additions and 10 deletions

View File

@ -2825,7 +2825,7 @@ class basic_json
AllocatorType<object_t> alloc;
alloc.destroy(m_value.object);
alloc.deallocate(m_value.object, 1);
break;
return;
}
case value_t::array:
@ -2833,7 +2833,7 @@ class basic_json
AllocatorType<array_t> alloc;
alloc.destroy(m_value.array);
alloc.deallocate(m_value.array, 1);
break;
return;
}
case value_t::string:
@ -2841,15 +2841,21 @@ class basic_json
AllocatorType<string_t> alloc;
alloc.destroy(m_value.string);
alloc.deallocate(m_value.string, 1);
break;
return;
}
default:
case value_t::null:
case value_t::boolean:
case value_t::number_integer:
case value_t::number_unsigned:
case value_t::number_float:
case value_t::discarded:
{
// all other types need no specific destructor
break;
return;
}
}
assert(false);
}
/// @}

View File

@ -2825,7 +2825,7 @@ class basic_json
AllocatorType<object_t> alloc;
alloc.destroy(m_value.object);
alloc.deallocate(m_value.object, 1);
break;
return;
}
case value_t::array:
@ -2833,7 +2833,7 @@ class basic_json
AllocatorType<array_t> alloc;
alloc.destroy(m_value.array);
alloc.deallocate(m_value.array, 1);
break;
return;
}
case value_t::string:
@ -2841,15 +2841,21 @@ class basic_json
AllocatorType<string_t> alloc;
alloc.destroy(m_value.string);
alloc.deallocate(m_value.string, 1);
break;
return;
}
default:
case value_t::null:
case value_t::boolean:
case value_t::number_integer:
case value_t::number_unsigned:
case value_t::number_float:
case value_t::discarded:
{
// all other types need no specific destructor
break;
return;
}
}
assert(false);
}
/// @}