MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / sum_flag_vector

Function sum_flag_vector

simcore/framework/src/cli/cli.hpp:1812–1818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1810template <typename T,
1811 enable_if_t<std::is_integral<T>::value && std::is_unsigned<T>::value, detail::enabler> = detail::dummy>
1812void sum_flag_vector(const std::vector<std::string> &flags, T &output) {
1813 std::int64_t count{0};
1814 for (auto &flag : flags) {
1815 count += detail::to_flag_value(flag);
1816 }
1817 output = (count > 0) ? static_cast<T>(count) : T{0};
1818}
1819
1820/// Sum a vector of flag representations
1821/// The flag vector produces a series of strings in a vector, simple true is represented by a "1", simple false is

Callers 2

add_flagMethod · 0.85
add_flag_functionMethod · 0.85

Calls 1

to_flag_valueFunction · 0.85

Tested by

no test coverage detected