
AMDG peter_foelsche@agilent.com wrote:
template<typename I2E_PAIR, typename E2I>
struct CCreatePair:boost::mpl::pair<typename I2E_PAIR::first, boost::mpl::at<E2I, typename I2E_PAIR::second> >
typename boost::mpl::at<...>::type
{
};
struct CDoSomething
{ template<unsigned int INDEX0, unsigned int INDEX1>
template<int INDEX0, int INDEX1> gcc is picky about the types matching.
inline void operator()(const boost::mpl::pair<boost::mpl::int_<INDEX0>, boost::mpl::int_<INDEX1> > &_r) const
{ std::cout << INDEX0 << " " << INDEX1 << "\n";
}
};
int main(int, char**)
{ boost::mpl::for_each<
CMapForward,
template CCreatePair<boost::mpl::_1, CMapReverse>
boost::mpl::lambda<CCreatePair<boost::mpl::_1, CMapReverse> >::type I'm not sure why the lambda is needed, but otherwise, the compiler tries to instantiate CCreatePair<boost::mpl::_1, CMapReverse> In Christ, Steven Watanabe