! @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
| 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 | ////////////////////////// |
no outgoing calls
no test coverage detected