|
Boost Users : |
Subject: Re: [Boost-users] Visiting an element of fusion sequence, selected at run-time
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2010-11-29 01:35:05
On Mon, Nov 29, 2010 at 12:53 AM, Max Motovilov <max_at_[hidden]> wrote:
> Here's a seemingly simple problem that I have spent most of my Thanksgiving
> weekend on, and still don't have enough to boast:
>
> Given:
>
> 1. A Boost.Fusion-compatible sequence;
> 2. An integral value i computed at runtime, known to be within
> 0..size(sequence);
Weird, this is the second time I've recommended the following in a week --
the easiest way to do what you want is with Steven Watanabe's switch
utility. It was up for review a couple years ago and was accepted pending
some changes but I don't think it was ever updated
Documentation: http://dancinghacker.com/switch/
and you can get it from the Boost vault here: http://tinyurl.com/23qn7w
-- -Matt Calabrese
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