diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-09-19 11:52:27 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-09-19 17:50:58 +0300 |
commit | 73f71e19965e07534eb47701f2b23c9ed59ef475 (patch) | |
tree | c660c5a5933c4577d965adce2109003ce5ed40b8 /src/net.h | |
parent | c30f79d418e2e001f1f804a2370db47e5d9ea587 (diff) |
refactor: Use explicit function type instead of template
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -258,8 +258,8 @@ public: void PushMessage(CNode* pnode, CSerializedNetMsg&& msg); - template<typename Callable> - void ForEachNode(Callable&& func) + using NodeFn = std::function<void(CNode*)>; + void ForEachNode(const NodeFn& func) { LOCK(cs_vNodes); for (auto&& node : vNodes) { @@ -268,8 +268,7 @@ public: } }; - template<typename Callable> - void ForEachNode(Callable&& func) const + void ForEachNode(const NodeFn& func) const { LOCK(cs_vNodes); for (auto&& node : vNodes) { |