//cross(or cartesian) product of sequence of domains. // (C) Copyright Larry Evans 2010. // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // #ifndef BOOST_MPL_CROSS_PRODUCT_HPP_INCLUDED #define BOOST_MPL_CROSS_PRODUCT_HPP_INCLUDED #include #include #include #include #include #include namespace boost { namespace mpl { namespace detail { namespace _cross_product_pack { template < templateclass Push=mpl::push_back > struct cross_many_one { template < typename Many , typename One > struct apply { typedef typename outer_product_pack < Push,arg<2> > >::template apply::type cross_nested ; typedef typename fold_assoc_seq < assoc_left , join_pack,arg<2> > , package<> , cross_nested >::type type //Given: // cross_nested = // package // < package // , package // // . // . // . // // , package // > //Produces "flattened" version of cross_nested: // type = // package // < e1_1, e1_2, ... , e1_n[1] // , e2_1, e2_2, ... , e2_n[2] // // . // . // . // // , em_1, em_2, ... , em_n[m] // > ; };//template apply }; }//exit _cross_product_pack namespace }//exit detail namespace template < typename domains , templateclass Push=push_back > struct cross_product_pack ; template < typename... domains , templateclass Push > struct cross_product_pack < package , Push > { typedef typename fold_assoc_seq < assoc_left , detail::_cross_product_pack::cross_many_one , package > , package >::type type ; }; }//exit mpl namespace }//exit boost namespace #endif