Fix up a few operator things in amit's code.

This commit is contained in:
Zed A. Shaw 2025-01-11 15:07:25 -05:00
parent 079734941c
commit 2b53363635
2 changed files with 2 additions and 7 deletions

View file

@ -53,7 +53,7 @@ namespace amt {
{} {}
constexpr bool empty() const noexcept { return m_data.empty(); }; constexpr bool empty() const noexcept { return m_data.empty(); };
constexpr bool size() const noexcept { return m_data.size(); }; constexpr size_type size() const noexcept { return m_data.size(); };
constexpr size_type rows() const noexcept { return m_row; }; constexpr size_type rows() const noexcept { return m_row; };
constexpr size_type cols() const noexcept { return m_col; }; constexpr size_type cols() const noexcept { return m_col; };

View file

@ -33,12 +33,7 @@ TEST_CASE("basic matrix iterator", "[matrix2:basic]") {
print("{} ", cell); print("{} ", cell);
} }
println("DIRECT ACCESS"); println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DIRECT ACCESS operator() has a bug.");
for(size_t y = 0; y < test.rows(); y++) {
for(size_t x = 0; x < test.cols(); x++) {
print("{} ", test(x, y));
}
}
auto filled = test; auto filled = test;
std::fill(filled.begin(), filled.end(), 8); std::fill(filled.begin(), filled.end(), 8);