Commit b7968b18 authored by Nicolas Michon's avatar Nicolas Michon

Add another 'make_fn' utility function

parent 2bc01f24
......@@ -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