Commit b9f1b75a authored by Simon Morlat's avatar Simon Morlat

Merge branch 'dev/make_fn' into 'master'

Add another 'make_fn' utility function

See merge request !1
parents 2bc01f24 b7968b18
Pipeline #509 passed with stage
in 0 seconds
......@@ -283,13 +283,17 @@ public:
BELR_PUBLIC std::shared_ptr<DebugElement> parseInput(const std::string &rulename, const std::string &input, size_t *parsed_size);
};
//Utility functions for handlers/collectors objects instantiation and properties accessors
template <typename _retT>
std::function< std::shared_ptr<_retT> ()> make_fn() {
return std::bind(&std::make_shared<_retT>);
}
template <typename _retT>
std::function< _retT ()> make_fn(_retT (*arg)()){
return std::function<_retT ()>(arg);
}
template <typename _retT, typename _arg1T, typename _arg2T>
std::function< _retT (_arg1T,_arg2T)> make_fn(_retT (*arg)(_arg1T,_arg2T)){
return std::function< _retT (_arg1T,_arg2T)>(arg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment