summaryrefslogtreecommitdiffstats
path: root/src/count.hpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2018-02-26 09:14:31 -0600
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-02-27 18:36:05 +0000
commit1abcb06bedadfbd40b4ec6f7e5f6a95021df3c96 (patch)
tree119da3b2d0af7e31a42dc29f8ec7dc79a85f9af3 /src/count.hpp
parent3c5318d843651dd18a6b8b0da67e3aaef810ca91 (diff)
downloadphosphor-dbus-monitor-1abcb06bedadfbd40b4ec6f7e5f6a95021df3c96.tar.gz
phosphor-dbus-monitor-1abcb06bedadfbd40b4ec6f7e5f6a95021df3c96.zip
Add constants for tuple fields
Add constants for use with std::get. Tested: Run unit tests Change-Id: Ic09c13feeda69d61c98f63d227cae8f08d1bf50e Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'src/count.hpp')
-rw-r--r--src/count.hpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/count.hpp b/src/count.hpp
index 0da0324..9f0ce3e 100644
--- a/src/count.hpp
+++ b/src/count.hpp
@@ -64,18 +64,19 @@ class CountCondition : public IndexedConditional
{
//Get the property value from storage[0],
//and save the op result in storage[1].
- const auto& storage = std::get<2>(
+ const auto& storage = std::get<storageIndex>(
item.second);
// Don't count properties that don't exist.
- if (std::get<0>(storage.get()).empty())
+ if (std::get<valueIndex>(
+ storage.get()).empty())
{
return false;
}
const auto& value = any_ns::any_cast<T>(
- std::get<0>(storage.get()));
+ std::get<valueIndex>(storage.get()));
auto r = propertyOp(value);
- std::get<1>(storage.get()) = r;
+ std::get<resultIndex>(storage.get()) = r;
return r;
});
OpenPOWER on IntegriCloud