Assertions added

This commit is contained in:
Maarten L. Hekkelman
2026-02-13 09:34:40 +01:00
parent 6348f59f15
commit 79674aef8f
5 changed files with 6 additions and 7 deletions

View File

@@ -827,9 +827,6 @@ struct const_item_handle
/** Easy way to test for an empty item */
explicit operator bool() const { return not empty(); }
/** Return a std::string_view for the contents */
[[nodiscard]] std::string_view text_() const;
/**
* @brief Construct a new item handle object
*

View File

@@ -398,7 +398,7 @@ class const_row_handle
/// \brief return a cif::item_handle to the item in the item named @a item_name
const_item_handle operator[](std::string_view item_name) const
{
return { *m_category, *m_row, get_item_ix(item_name) };
return operator[](get_item_ix(item_name));
}
/// \brief Return an object that can be used in combination with cif::tie

View File

@@ -1030,9 +1030,8 @@ condition category::get_parents_condition(const_row_handle rh, const category &p
condition result;
auto links = m_validator->get_links_for_child(m_name);
auto e = std::ranges::remove_if(links, [n = parentCat.m_name](auto &l)
std::erase_if(links, [n = parentCat.m_name](auto &l)
{ return l->m_parent_category != n; });
links.erase(e.begin(), e.end());
if (not links.empty())
{

View File

@@ -43,11 +43,13 @@ bool item_handle::empty() const
item_value &item_handle::value()
{
assert(m_item_ix < m_row.size());
return m_row.operator[](m_item_ix);
}
const item_value &item_handle::value() const
{
assert(m_item_ix < m_row.size());
return m_row.operator[](m_item_ix);
}
@@ -64,6 +66,7 @@ bool const_item_handle::empty() const
const item_value &const_item_handle::value() const
{
assert(m_item_ix < m_row.size());
return m_row.operator[](m_item_ix);
}

View File

@@ -44,7 +44,7 @@ list(
unit-3d
model
# query
# rename-compound
rename-compound
# sugar
# spinner
# reconstruction