diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2017-07-10 13:04:17 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-07-17 14:16:33 +0300 |
commit | 191d3d497aff074c3545d929a5858e063950031c (patch) | |
tree | e52c937a3f699061a8bac43bf72812ea6a184178 /indexer/ftypes_mapping.hpp | |
parent | 4cddde8283ce8c8e55e653579b9ec6e5e611dcf1 (diff) |
Added matcher for ugc objects.
Diffstat (limited to 'indexer/ftypes_mapping.hpp')
-rw-r--r-- | indexer/ftypes_mapping.hpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/indexer/ftypes_mapping.hpp b/indexer/ftypes_mapping.hpp index 32dfb36008..d21553be1b 100644 --- a/indexer/ftypes_mapping.hpp +++ b/indexer/ftypes_mapping.hpp @@ -44,19 +44,26 @@ public: { return IsValid(Find(types)); } - - template<typename TypesPaths, typename ... Args> - void Append(TypesPaths const & types, Args const & ... args) + template <typename Type, typename... Args> + void AppendType(Type && type, Args &&... args) { - for (auto const & type : types) { #if defined(DEBUG) feature::TypesHolder holder; holder.Assign(classif().GetTypeByPath(type)); ASSERT(Find(holder) == m_mapping.cend(), ("This type already exists", type)); #endif - m_mapping.emplace(classif().GetTypeByPath(type), args...); } + m_mapping.emplace(classif().GetTypeByPath(std::forward<Type>(type)), + std::forward<Args>(args)...); + } + + template <typename TypesPaths, typename... Args> + void Append(TypesPaths && types, Args &&... args) + { + // We mustn't forward args in the loop below because it will be forwarded at first iteration. + for (auto const & type : types) + AppendType(type, args...); } private: |