Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] runtime unsigned to a template argument compile-time unsigned
From: Larry Evans (cppljevans_at_[hidden])
Date: 2010-02-22 11:17:10


On 02/22/10 10:02, Larry Evans wrote:
> On 02/21/10 05:27, Hicham Mouline wrote:
> [snip]
>>>
>> 3. Can I generate an array of function pointers to the various
>> at<>() functions and call the right one at runtime?
>
> The 2 attached files show how this can be done.
>
> Obviously, instead of:
>
> typedef
> void(*
> method_type
> )(void)
> ;
>
> you'd have:
>
> typedef
> double(*
> method_type
> )(void)
> ;
>
This could even be done for heterogeneous return types; however,
in that case, a tagged variant. The tag for this variant would
be the field index. In the attached code, this would be something
like the super_numerals.


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