Change struct to a function
No reason for the visitor to be a struct.
Change-Id: If63415b52d52a23ec24733a4c3268547d8fbdbef
diff --git a/src/ast_handlers.hpp b/src/ast_handlers.hpp
index 540d7e2..5b5a152 100644
--- a/src/ast_handlers.hpp
+++ b/src/ast_handlers.hpp
@@ -409,13 +409,11 @@
}
};
-struct commandNamesVisitor {
- template <typename T>
- std::string operator()(boost::type<T>)
- {
- return T::name;
- }
-};
+template <typename T>
+std::string commandNamesVisitor (boost::type<T>)
+{
+ return T::name;
+}
struct createCommandSuggestions_class {
template <typename T, typename Iterator, typename Context>
@@ -426,7 +424,7 @@
parserContext.m_suggestions.clear();
boost::mpl::for_each<CommandTypes, boost::type<boost::mpl::_>>([&parserContext](auto cmd) {
- parserContext.m_suggestions.insert({commandNamesVisitor()(cmd), " "});
+ parserContext.m_suggestions.insert({commandNamesVisitor(cmd), " "});
});
}
};