#include #include #include #include #include #include #include #include template struct CDer; template struct CMyOperation { const CDer &m_r0; const CDer &m_r1; typename CDer > > CDerOr; CDerOr &m_rT; unsigned int m_iPos; CMyOperation(const CThis &_r0, const CDer &_r1, CDerOr &_rT) :m_r0(_r0), m_r1(_r1), m_rT(_rT), m_iPos(0) { } void operator()(const std::pair &_r) { ++m_iPos; } }; struct CCreatePair { std::pair operator()(const bool _b0, const bool _b1) const { return std::pair(_b0, _b1); } }; template struct CDer { public: typedef CDer CThis; inline CDer(void) { } template friend inline CMyOperation::CDerOr myOperation(const CThis &_r0, const CDer &_r1) { CMyOperation::CDerOr sRet; typedef boost::mpl::transform CMerged; CMyOperation sOp(_r0, _r1, sRet); boost::mpl::for_each(sOp); return sRet; } }; int main(int argc, char **argv) { CDer::type > sDer0; CDer::type > sDer1; myOperation(sDer0, sDer1); return 0; }