Opened 5 years ago
#13114 new Feature Requests
Multiple signatures for function
Reported by: | Owned by: | Douglas Gregor | |
---|---|---|---|
Milestone: | To Be Determined | Component: | function |
Version: | Boost 1.63.0 | Severity: | Not Applicable |
Keywords: | Cc: |
Description
I am not familiar with boost, just wanted to suggest the possibility of having function
take multiple signatures
function<void (int), int (double)> f;
This is compatible with std::function
, but unknown feasibility for boost::function
in its current form.
The key idea is to recursively implement operator()
from the argument list
template<typename Ret, typename... Args, typename... Fns> struct erasure_base<Ret (Args...), Fns...> : erasure_base<Fns...> { virtual Ret operator()(Args&&...) = 0; using erasure_base<Fns...>::operator(); };
Attached file is a proof-of-concept implementation of such functionality.
Attachments (1)
Note:
See TracTickets
for help on using tickets.
Proof-of-concept for function taking multiple signatures