MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / assert_invariant

Function assert_invariant

Source/Utils/json.hpp:17709–17715  ·  view source on GitHub ↗

! @brief checks the class invariants This function asserts the class invariants. It needs to be called at the end of every constructor to make sure that created objects respect the invariant. Furthermore, it has to be called each time the type of a JSON value is changed, because the invariant expresses a relationship between @a m_type and @a m_value

Source from the content-addressed store, hash-verified

17707 @a m_type and @a m_value.
17708 */
17709 void assert_invariant() const noexcept
17710 {
17711 JSON_ASSERT(m_type != value_t::object || m_value.object != nullptr);
17712 JSON_ASSERT(m_type != value_t::array || m_value.array != nullptr);
17713 JSON_ASSERT(m_type != value_t::string || m_value.string != nullptr);
17714 JSON_ASSERT(m_type != value_t::binary || m_value.binary != nullptr);
17715 }
17716
17717 public:
17718 //////////////////////////

Callers 10

basic_jsonFunction · 0.85
json.hppFile · 0.85
~basic_jsonFunction · 0.85
operator[]Function · 0.85
eraseFunction · 0.85
push_backFunction · 0.85
emplace_backFunction · 0.85
emplaceFunction · 0.85
updateFunction · 0.85
swapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected