|
@@ -8,6 +8,7 @@
|
|
|
#include <type_traits>
|
|
#include <type_traits>
|
|
|
#include <utility>
|
|
#include <utility>
|
|
|
#include <vector>
|
|
#include <vector>
|
|
|
|
|
+#include "../config/config.h"
|
|
|
#include "../core/compressed_pair.hpp"
|
|
#include "../core/compressed_pair.hpp"
|
|
|
#include "../core/iterator.hpp"
|
|
#include "../core/iterator.hpp"
|
|
|
#include "fwd.hpp"
|
|
#include "fwd.hpp"
|
|
@@ -372,6 +373,25 @@ public:
|
|
|
return std::forward_as_tuple(std::get<container_for<Row>>(payload.first()).emplace_back(std::forward<Args>(args))...);
|
|
return std::forward_as_tuple(std::get<container_for<Row>>(payload.first()).emplace_back(std::forward<Args>(args))...);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Removes a row from a table.
|
|
|
|
|
+ * @param pos An iterator to the row to remove.
|
|
|
|
|
+ * @return An iterator following the removed row.
|
|
|
|
|
+ */
|
|
|
|
|
+ iterator erase(const_iterator pos) {
|
|
|
|
|
+ const auto diff = pos - begin();
|
|
|
|
|
+ return {std::get<container_for<Row>>(payload.first()).erase(std::get<container_for<Row>>(payload.first()).begin() + diff)...};
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Removes a row from a table.
|
|
|
|
|
+ * @param pos Index of the row to remove.
|
|
|
|
|
+ */
|
|
|
|
|
+ void erase(const size_type pos) {
|
|
|
|
|
+ ENTT_ASSERT(pos < size(), "Index out of bounds");
|
|
|
|
|
+ erase(begin() + static_cast<typename const_iterator::difference_type>(pos));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Returns the row data at specified location.
|
|
* @brief Returns the row data at specified location.
|
|
|
* @param pos The row for which to return the data.
|
|
* @param pos The row for which to return the data.
|