diff options
-rw-r--r-- | icespider/core/util.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/icespider/core/util.h b/icespider/core/util.h index 06ccbcc..f4d559b 100644 --- a/icespider/core/util.h +++ b/icespider/core/util.h @@ -70,12 +70,7 @@ template<typename T> struct type_names { static constexpr auto namespaces() { - auto ns {0U}; - for (const auto & c : name()) { - // cppcheck-suppress useStlAlgorithm; (not constexpr) - ns += (c == ':') ? 1 : 0; - } - return ns / 2; + return std::count(name().begin(), name().end(), ':') / 2; } using char_type = typename decltype(name())::value_type; |