xaizek / dit (License: GPLv3) (since 2018-12-07)
Command-line task keeper that remembers all old values and is meant to combine several orthogonal features to be rather flexible in managing items.
Commit 66a078011deaed9c8bdf0864a236144fcab0f715

Accept std::function by reference in ItemFilter
Taking it by value seems to be a useless waste.
Author: xaizek
Author date (UTC): 2018-11-01 10:44
Committer name: xaizek
Committer date (UTC): 2018-11-01 10:44
Parent(s): 5d11f09e3b3e70f83daee734f38a23bb8dd806e1
Signing key: 99DC5E4DB05F6BE2
Tree: 4676bab48b0e866bac2943a1c27ff2e28b29b5f9
File Lines added Lines deleted
src/ItemFilter.cpp 3 2
src/ItemFilter.hpp 3 2
File src/ItemFilter.cpp changed (mode: 100644) (index 6692066..ce995bf)
... ... ItemFilter::passes(Item &item) const
67 67 } }
68 68
69 69 bool bool
70 ItemFilter::passes(std::function<accessor_f> accessor) const
70 ItemFilter::passes(const std::function<accessor_f> &accessor) const
71 71 { {
72 72 std::string error; std::string error;
73 73 return passes(accessor, error); return passes(accessor, error);
74 74 } }
75 75
76 76 bool bool
77 ItemFilter::passes(std::function<accessor_f> accessor, std::string &error) const
77 ItemFilter::passes(const std::function<accessor_f> &accessor,
78 std::string &error) const
78 79 { {
79 80 error.clear(); error.clear();
80 81
File src/ItemFilter.hpp changed (mode: 100644) (index b8c716b..bc79cf0)
... ... public:
80 80 * *
81 81 * @returns @c true if it passes, and @c false otherwise. * @returns @c true if it passes, and @c false otherwise.
82 82 */ */
83 bool passes(std::function<accessor_f> accessor) const;
83 bool passes(const std::function<accessor_f> &accessor) const;
84 84
85 85 /** /**
86 86 * @brief Checks whether item represented by its fields passes the filter. * @brief Checks whether item represented by its fields passes the filter.
 
... ... public:
90 90 * *
91 91 * @returns @c true if it passes, and @c false otherwise. * @returns @c true if it passes, and @c false otherwise.
92 92 */ */
93 bool passes(std::function<accessor_f> accessor, std::string &error) const;
93 bool passes(const std::function<accessor_f> &accessor,
94 std::string &error) const;
94 95
95 96 private: private:
96 97 /** /**
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/dit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/dit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master