| 13253 | */ |
| 13254 | template < typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::nullptr_t > = nullptr > |
| 13255 | bool operator==(const IterImpl& other) const |
| 13256 | { |
| 13257 | // if objects are not the same, the comparison is undefined |
| 13258 | if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) |
| 13259 | { |
| 13260 | JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers", m_object)); |
| 13261 | } |
| 13262 | |
| 13263 | JSON_ASSERT(m_object != nullptr); |
| 13264 | |
| 13265 | switch (m_object->m_type) |
| 13266 | { |
| 13267 | case value_t::object: |
| 13268 | return (m_it.object_iterator == other.m_it.object_iterator); |
| 13269 | |
| 13270 | case value_t::array: |
| 13271 | return (m_it.array_iterator == other.m_it.array_iterator); |
| 13272 | |
| 13273 | case value_t::null: |
| 13274 | case value_t::string: |
| 13275 | case value_t::boolean: |
| 13276 | case value_t::number_integer: |
| 13277 | case value_t::number_unsigned: |
| 13278 | case value_t::number_float: |
| 13279 | case value_t::binary: |
| 13280 | case value_t::discarded: |
| 13281 | default: |
| 13282 | return (m_it.primitive_iterator == other.m_it.primitive_iterator); |
| 13283 | } |
| 13284 | } |
| 13285 | |
| 13286 | /*! |
| 13287 | @brief comparison: not equal |
nothing calls this directly
no test coverage detected