|
Boost Users : |
Subject: Re: [Boost-users] [fusion] runtime unsigned to a template argument compile-time unsigned
From: Hicham Mouline (hicham_at_[hidden])
Date: 2010-02-22 14:59:47
-----Original Message-----
From: "Larry Evans" [cppljevans_at_[hidden]]
Date: 22/02/2010 07:23 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [fusion] runtime unsigned to a template argument
compile-time unsigned
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.
------------------------
This looks like it should go, already is in some library?
I have many places where I read the index, and I would like to use the index as the template argument,
thanks very much, will do,
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