niyue commented on code in PR #37752:
URL: https://github.com/apache/arrow/pull/37752#discussion_r1328093232
##########
cpp/src/gandiva/exported_funcs_registry.h:
##########
@@ -36,19 +36,11 @@ class ExportedFuncsRegistry {
static void AddMappings(Engine* engine);
static bool Register(std::shared_ptr<ExportedFuncsBase> entry) {
- registered().push_back(entry);
+ registered().emplace_back(std::move(entry));
return true;
}
private:
- static list_type& registered() {
- static list_type registered_list;
- return registered_list;
- }
+ static list_type& registered();
};
-
-#define REGISTER_EXPORTED_FUNCS(classname) \
- static bool _registered_##classname = \
- ExportedFuncsRegistry::Register(std::make_shared<classname>())
Review Comment:
No problem. I added back the macro, but the `static bool
_registered_##classname` variable is never used, and when this macro is used
inside a function, this triggers a compiler warning `unused variable
'_registered_ExportedStubFunctions' [-Werror,-Wunused-variable]` which fails
the build, and I have to add an additional `[[maybe_unused]]` (C++17 attribute)
to this macro to suppress this warning.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]