mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
AK: Fully qualify use of move
in TemporaryChange
For some reason, after some seemingly unrelated upcoming changes, the unqualified `move`s in this header result in an ADL failure: AK/TemporaryChange.h:22:39: error: call to function 'move' that is neither visible in the template definition nor found by argument- dependent lookup 22 | ~TemporaryChange() { m_variable = move(m_old_value); } | ^ Libraries/LibDNS/Resolver.h:491:29: note: in instantiation of member function 'AK::TemporaryChange<bool>::~TemporaryChange' requested here 491 | TemporaryChange change(m_attempting_restart, true);
This commit is contained in:
parent
cbf47abd24
commit
3961a4f16a
Notes:
github-actions[bot]
2025-03-22 16:29:33 +00:00
Author: https://github.com/trflynn89
Commit: 3961a4f16a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4036
1 changed files with 8 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/Platform.h>
|
#include <AK/Platform.h>
|
||||||
|
#include <AK/StdLibExtras.h>
|
||||||
|
|
||||||
namespace AK {
|
namespace AK {
|
||||||
|
|
||||||
|
@ -15,11 +16,15 @@ class TemporaryChange {
|
||||||
public:
|
public:
|
||||||
TemporaryChange(T& variable, T value)
|
TemporaryChange(T& variable, T value)
|
||||||
: m_variable(variable)
|
: m_variable(variable)
|
||||||
, m_old_value(move(variable))
|
, m_old_value(AK::move(variable))
|
||||||
{
|
{
|
||||||
m_variable = move(value);
|
m_variable = AK::move(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
~TemporaryChange()
|
||||||
|
{
|
||||||
|
m_variable = AK::move(m_old_value);
|
||||||
}
|
}
|
||||||
~TemporaryChange() { m_variable = move(m_old_value); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T& m_variable;
|
T& m_variable;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue