Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Functional.OverloadedFunction][C++03] Number of overloads in boost::overload_function<...>
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2012-10-19 02:40:07


On Thu, Oct 18, 2012 at 8:54 PM, Felipe Magno de Almeida
<felipe.m.almeida_at_[hidden]> wrote:
> Hello,
>
> Sorry, I didn't have much time to write this email sooner.
>
> On Fri, Oct 19, 2012 at 12:42 AM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
>> AMDG
>>
>> On 10/17/2012 07:50 AM, Lorenzo Caminiti wrote:
>>> On Wed, Oct 17, 2012 at 4:24 AM, Felipe Magno de Almeida
>>> <felipe.m.almeida_at_[hidden]> wrote:
>>>> That's a bit restricting. I could really use a overloaded_function
>>>> that received a MPL or Fusion
>>>> sequence as well.
>>>
>>> Why do you need to use MPL and Fusion sequences? What's the use case?
>>
>> This would happen if the overloads are computed
>> by metaprogramming instead of being hard-coded
>> into the source.
>
> Yes. That's exactly the case. I'm writing a Java Binding library, and
> all I need to pass at runtime is three variables to create an overload
> set that is mapped to functions in Java. And at compile time I need
> to specify all the function overloads. Since it is not necessary, I
> don't want the user to create all function objects seperately, since
> their constructions are all the same. I need to pass just a sequence
> of function prototypes and the three variables I mentioned and I can
> just return a boost.overloadedfunction constructed by metaprogramming.

This is fine. Also as Steven mentioned using Fusion sequences might
provide an API to support generic algorithms on the
overloaded_function type which is useful on itself. I'm willing to add
either the MPL or Fusion sequence to the API (it should be backward
compatible). However, I'd like to see some example code as a use case
against which I can implement such a functionality. Can you please
post, in a form or another, the code that you are trying to program?

Thanks,
--Lorenzo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net