MCPcopy Create free account
hub / github.com/KTH-RPL/dufomap / equal_to_container

Function equal_to_container

src/toml.hpp:6811–6832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

operator==Function · 0.85

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected