|
Boost : |
From: Andy Little (andy_at_[hidden])
Date: 2006-09-10 14:25:42
"Andy Little" <andy_at_[hidden]> wrote in message
news:edv632$3ku$1_at_sea.gmane.org...
>
> "Joel de Guzman" <joel_at_[hidden]> wrote
>> Indeed. Also, with Fusion, you have the option to use purely
>> constant sequences such as mpl::vector_c together with plain
>> sequences, or even user defined sequences and adapted/converted
>> structs/classes.
>
> Right. I started looking into this scheme for math ops. I opted for a zero and
> a
> one, but then I figured that one + one should go to two etc.
>
> In the end I opted for a static_value<StaticValue,RunTimeType>
>
> StaticValue could then be any of mpl::int_ etc, though for mpl int_ division
> is
> ( can be) lossy so at that point the division should turn the result into the
> RunTimeType. other possibilities for StaticValue are a compile time rational,
> maybe with a long long value_type. At any point where the compile time value
> will run out of steam then the type will be automatically converted to the
> RunTimeType.
>
> All in all... how to take a simple idea and make it very very complicated :-)
static_value now implemented, though I changed the param order. runtime and
static values should be able to be arbitarily mixed in same tuple. Also tested
(after some mods) in the quan::fusion::dot_product functor
<quan/fusion/dot_product.hpp>
Example:
http://tinyurl.com/gq3a4
http://sourceforge.net/projects/quan
regards
Andy Little
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk