remove std::function inheritance

This does nothing but bloat code size.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2025-06-20 17:59:09 -07:00
committed by Jari Sundell
parent 5175414333
commit 34aba86d67
3 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -38,7 +38,6 @@
#define RAK_ALGORITHM_H
#include <algorithm>
#include <functional>
#include <limits>
namespace rak {
@@ -115,7 +114,7 @@ advance_backward(_InputIter __first, _InputIter __last, _Distance __distance) {
}
template <typename _Value>
struct compare_base : public std::function<bool(_Value, _Value)> {
struct compare_base {
bool operator () (const _Value& complete, const _Value& base) const {
return !complete.compare(0, base.size(), base);
}
+1 -1
View File
@@ -50,7 +50,7 @@
namespace rak {
class regex : public std::function<bool (std::string)> {
class regex {
public:
regex() {}
regex(const std::string& p) : m_pattern(p) {}
+2 -2
View File
@@ -16,7 +16,7 @@
namespace core {
// Also add focus thingie here?
struct view_downloads_compare : std::function<bool (Download*, Download*)> {
struct view_downloads_compare {
view_downloads_compare(const torrent::Object& cmd) :
m_command(cmd) {}
@@ -50,7 +50,7 @@ struct view_downloads_compare : std::function<bool (Download*, Download*)> {
const torrent::Object& m_command;
};
struct view_downloads_filter : std::function<bool (Download*)> {
struct view_downloads_filter {
view_downloads_filter(const torrent::Object& cmd, const torrent::Object& cmd2) :
m_command(cmd), m_command2(cmd2) {}