First implementation of custom path type.
This commit is contained in:
@@ -251,12 +251,13 @@ public:
|
||||
return eraseImpl(idx, count);
|
||||
}
|
||||
|
||||
template<std::equality_comparable_with<TKey> T>
|
||||
[[nodiscard]]
|
||||
iterator find(const TKey& key) MIJIN_NOEXCEPT
|
||||
iterator find(const T& keyValue) MIJIN_NOEXCEPT
|
||||
{
|
||||
for (std::size_t idx = 0; idx < keys_.size(); ++idx)
|
||||
{
|
||||
if (keys_[idx] == key)
|
||||
if (keys_[idx] == keyValue)
|
||||
{
|
||||
return iterator(&keys_[idx], &values_[idx]);
|
||||
}
|
||||
@@ -264,12 +265,13 @@ public:
|
||||
return end();
|
||||
}
|
||||
|
||||
template<std::equality_comparable_with<TKey> T>
|
||||
[[nodiscard]]
|
||||
const_iterator find(const TKey& key) const MIJIN_NOEXCEPT
|
||||
const_iterator find(const T& keyValue) const MIJIN_NOEXCEPT
|
||||
{
|
||||
for (std::size_t idx = 0; idx < keys_.size(); ++idx)
|
||||
{
|
||||
if (keys_[idx] == key)
|
||||
if (keys_[idx] == keyValue)
|
||||
{
|
||||
return const_iterator(&keys_[idx], &values_[idx]);
|
||||
}
|
||||
@@ -277,10 +279,11 @@ public:
|
||||
return end();
|
||||
}
|
||||
|
||||
template<std::equality_comparable_with<TKey> T>
|
||||
[[nodiscard]]
|
||||
bool contains(const TKey& key) const MIJIN_NOEXCEPT
|
||||
bool contains(const T& keyValue) const MIJIN_NOEXCEPT
|
||||
{
|
||||
return std::ranges::contains(keys_, key);
|
||||
return std::ranges::contains(keys_, keyValue);
|
||||
}
|
||||
private:
|
||||
iterator eraseImpl(std::ptrdiff_t idx, std::ptrdiff_t count = 1) MIJIN_NOEXCEPT
|
||||
|
||||
Reference in New Issue
Block a user