Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] is there anything resembling a joint_view of 2 maps?
From: er (erwann.rogard_at_[hidden])
Date: 2009-10-22 17:34:37


> Either way, for now you can workaround your issue by providing your own
> extension implementations for
> fusion::extension::category_of_impl<fusion::joint_view_tag>,
> fusion::extension::has_key_impl<fusion::joint_view_tag> and
> fusion::extension::at_key_impl<fusion::joint_view_tag>, or, even better,
> wrap the joint_view up in another view which implements both (forward
> and associative) extension backends.
>

Thanks, but the workaround you are suggesting is not obvious to me.
Maybe you can help? I have started here :

         template <>
         template<typename Seq1,typename Seq2,typename Key>
         struct at_key_impl<joint_view_tag>::apply<
             joint_view<Seq1,Seq2>,Key
>
         {
             typedef joint_view<Seq1,Seq2> jv_;

             typedef fusion::result_of::has_key<Seq1,Key> has_key1_;
             typedef typename mpl::if_<
                 has_key1_,
                 Seq1,
                 Seq2
>::type seq_;

             typedef typename result_of::at_key<seq_,Key>::type type;

             static type
             call(jv_& m)
             {
                 // return m.at_impl(mpl::identity<Key>());
                ????

             }
         };


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