Boost logo

Boost :

From: Christopher D. Russell (cdr_at_[hidden])
Date: 2004-12-09 11:26:13

I'm not sure I completely understand what information you're trying to get
out of the binary static visitor. Is the intention to deduce a type signature
from the ordered pair represented by the specific type stored in each of the
two input variants? Or, if the intention to return an instance of this type
initialized with data sourced from the two input variants? The pseudo code I
posted previously is an attempt to address the later.

Maybe a std::map<std::pair<int,int>, metafunction> where std::pair<int,int>
is std::make_pair(variant_a.which(), variant_b.which()) would work without
any visitation at all?

An interesting little puzzle with some extremely useful applications.

"Hartmut Kaiser" <hartmutkaiser_at_[hidden]> wrote in message
> Christopher D. Russell wrote:
>> The gist of my approach is to return another variant from the
>> binary version of the static visitor that is bounded by a the
>> permutations of the types of the two input variants. My plan
>> is to then operate on the return value using the unary
>> version of static visitor... Perhaps this isn't exactly what
>> you had in mind but it's all I could come up with. Perhaps
>> others will jump in and be able to suggest a better implementation?
> Thanks for this hint. Returning a variant from the visitor seems to be an
> option for me, but I'll have to investigate it more thoroughly.
> Initially I've expected to find some kind of meta function allowing to
> specify the required return type (as used in Phoenix and as it was
> mentioned
> here already), but this may not be possible in the context of the
> Boost.Variant library.
> Thanks and regards
> Hartmut
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at