How to loop through a boost::mpl::list?

前端 未结 1 1525
隐瞒了意图╮
隐瞒了意图╮ 2021-01-02 09:41

This is as far as I\'ve gotten,

#include 
#include 
namespace mpl = boost::mpl;

class RunAround {};
class HopUpAn         


        
1条回答
  •  时光说笑
    2021-01-02 10:39

    Use mpl::for_each for runtime iteration over type lists. E.g.:

    struct do_this_wrapper {
        template void operator()(U) {
            doThis();
        }
    };
    
    int main() {
        typedef boost::mpl::list acts;
        boost::mpl::for_each(do_this_wrapper());    
    };
    

    0 讨论(0)
提交回复
热议问题