Subject: Re: [boost] [functional] adding overload
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2012-02-06 11:53:14
Gordon Woodhull wrote
> On Jan 31, 2012, at 7:23 PM, Lorenzo Caminiti <lorcaminiti@> wrote:
>> Just the case that you have a bunch of functions (function pointers,
>> function references, and monomorphic functors) with different names
>> and you want to combine them into an API with a single overloaded
>> function name.
> I think this will be generally useful.
> I wonder if you have thought about the case where the source funcs are
> polymorphic? Can this be supported using the same technique or does it
> require some metaprogramming magic?
I don't think it is possible to handle polymorphic functions because
overloaded_function keeps a copy of the function (pointer, reference, or
object) into a member of type boost::function<signature> (then
boost::function is called within the overloaded_function operator() ). If
`signature` contains a generic template parameter type T, I can't form a
proper boost::function<signature> type to hold a copy of the function when
overloaded_function is constructed...
I will spend more time thinking and experimenting with this. I will post a
code example illustrating the exact issue if indeed I cannot support
-- View this message in context: http://boost.2283326.n4.nabble.com/functional-adding-overload-tp4297850p4361928.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk