summaryrefslogtreecommitdiffstats
path: root/control/actions.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'control/actions.hpp')
-rw-r--r--control/actions.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/control/actions.hpp b/control/actions.hpp
index 21d9365..8a2675b 100644
--- a/control/actions.hpp
+++ b/control/actions.hpp
@@ -24,16 +24,19 @@ namespace action
* A lambda function to set the zone speed when the number of properties
* within the group are at a certain value
*/
-auto count_state_before_speed(size_t count, bool state, uint64_t speed)
+template <typename T>
+auto count_state_before_speed(size_t count, T&& state, uint64_t speed)
{
- return [=](auto& zone, auto& group)
+ return [count,
+ speed,
+ state = std::forward<T>(state)](auto& zone, auto& group)
{
size_t numAtState = std::count_if(
group.begin(),
group.end(),
[&zone, &state](auto const& entry)
{
- return zone.getPropertyValue(
+ return zone.template getPropertyValue<T>(
entry.first,
std::get<intfPos>(entry.second),
std::get<propPos>(entry.second)) == state;
OpenPOWER on IntegriCloud