mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Fix clang-tidy modernize-avoid-bind check
And enable the check in the config. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
91a4b834a8
commit
eae57d9aab
2 changed files with 3 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2025 Wildfire Games.
|
/* Copyright (C) 2026 Wildfire Games.
|
||||||
* This file is part of 0 A.D.
|
* This file is part of 0 A.D.
|
||||||
*
|
*
|
||||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||||
|
|
@ -61,7 +61,7 @@ public:
|
||||||
|
|
||||||
template<typename C> ObservableConnection RegisterObserver(int order, void (C::*callback) (const T&), C* obj)
|
template<typename C> ObservableConnection RegisterObserver(int order, void (C::*callback) (const T&), C* obj)
|
||||||
{
|
{
|
||||||
return m_Signal.connect(order, std::bind(std::mem_fn(callback), obj, std::placeholders::_1));
|
return m_Signal.connect(order, std::bind_front(callback, obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
ObservableConnection RegisterObserver(int order, void (*callback) (const T&))
|
ObservableConnection RegisterObserver(int order, void (*callback) (const T&))
|
||||||
|
|
@ -133,7 +133,7 @@ public:
|
||||||
|
|
||||||
template<typename C> ObservableConnection RegisterObserver(int order, void (C::*callback) (T*), C* obj)
|
template<typename C> ObservableConnection RegisterObserver(int order, void (C::*callback) (T*), C* obj)
|
||||||
{
|
{
|
||||||
return m_Signal.connect(order, std::bind(std::mem_fn(callback), obj, std::placeholders::_1));
|
return m_Signal.connect(order, std::bind_front(callback, obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
ObservableConnection RegisterObserver(int order, void (*callback) (T*))
|
ObservableConnection RegisterObserver(int order, void (*callback) (T*))
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,6 @@ Checks:
|
||||||
- -cppcoreguidelines-use-enum-class
|
- -cppcoreguidelines-use-enum-class
|
||||||
- -cppcoreguidelines-virtual-class-destructor
|
- -cppcoreguidelines-virtual-class-destructor
|
||||||
- modernize-*
|
- modernize-*
|
||||||
- -modernize-avoid-bind
|
|
||||||
- -modernize-avoid-c-arrays
|
- -modernize-avoid-c-arrays
|
||||||
- -modernize-avoid-c-style-cast
|
- -modernize-avoid-c-style-cast
|
||||||
- -modernize-avoid-setjmp-longjmp
|
- -modernize-avoid-setjmp-longjmp
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue