| 6809 | |
| 6810 | template <typename T> |
| 6811 | TOML_NODISCARD |
| 6812 | static bool equal_to_container(const array& lhs, const T& rhs) noexcept |
| 6813 | { |
| 6814 | using element_type = std::remove_const_t<typename T::value_type>; |
| 6815 | static_assert(impl::is_losslessly_convertible_to_native<element_type>, |
| 6816 | "Container element type must be losslessly convertible one of the native TOML value types"); |
| 6817 | |
| 6818 | if (lhs.size() != rhs.size()) |
| 6819 | return false; |
| 6820 | if (rhs.size() == 0u) |
| 6821 | return true; |
| 6822 | |
| 6823 | size_t i{}; |
| 6824 | for (auto& list_elem : rhs) |
| 6825 | { |
| 6826 | const auto elem = lhs.get_as<impl::native_type_of<element_type>>(i++); |
| 6827 | if (!elem || *elem != list_elem) |
| 6828 | return false; |
| 6829 | } |
| 6830 | |
| 6831 | return true; |
| 6832 | } |
| 6833 | |
| 6834 | public: |
| 6835 |
no test coverage detected