mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
AK: Return a constant reference from HashMap's constant get() override
We cannot return a mutable reference from a constant function.
This commit is contained in:
parent
ef7f343e95
commit
2f67f2ba3d
1 changed files with 2 additions and 4 deletions
|
@ -154,8 +154,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
template<Concepts::HashCompatible<K> Key>
|
template<Concepts::HashCompatible<K> Key>
|
||||||
requires(IsSame<KeyTraits, Traits<K>>) Optional<typename ValueTraits::PeekType> get(Key const& key)
|
requires(IsSame<KeyTraits, Traits<K>>) Optional<typename ValueTraits::ConstPeekType> get(Key const& key) const
|
||||||
const
|
|
||||||
requires(!IsPointer<typename ValueTraits::PeekType>)
|
requires(!IsPointer<typename ValueTraits::PeekType>)
|
||||||
{
|
{
|
||||||
auto it = find(key);
|
auto it = find(key);
|
||||||
|
@ -165,8 +164,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
template<Concepts::HashCompatible<K> Key>
|
template<Concepts::HashCompatible<K> Key>
|
||||||
requires(IsSame<KeyTraits, Traits<K>>) Optional<typename ValueTraits::ConstPeekType> get(Key const& key)
|
requires(IsSame<KeyTraits, Traits<K>>) Optional<typename ValueTraits::ConstPeekType> get(Key const& key) const
|
||||||
const
|
|
||||||
requires(IsPointer<typename ValueTraits::PeekType>)
|
requires(IsPointer<typename ValueTraits::PeekType>)
|
||||||
{
|
{
|
||||||
auto it = find(key);
|
auto it = find(key);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue