我试图通过使用 boost MSM 状态机的显式模板实例化来减少项目的编译时间。但是,每当我添加显式模板实例化时,我的项目都不会编译。
您可以使用此处文档中的示例找到问题的示例:http: //coliru.stacked-crooked.com/a/9850cae23afdada2。(这是一个人为的例子,因为只有一个翻译单元,但错误与我在项目中使用显式模板实例化时的错误相同。)
有谁知道如何解决这些编译错误?
/usr/local/include/boost/msm/back/state_machine.hpp: In instantiation of 'boost::msm::back::state_machine<A0, A1, A2, A3, A4>::deferred_events_queue_t& boost::msm::back::state_machine<A0, A1, A2, A3, A4>::get_deferred_queue() [with A0 = player_; A1 = boost::parameter::void_; A2 = boost::parameter::void_; A3 = boost::parameter::void_; A4 = boost::parameter::void_; boost::msm::back::state_machine<A0, A1, A2, A3, A4>::deferred_events_queue_t = std::deque<std::pair<boost::function<boost::msm::back::HandledEnum()>, bool>, std::allocator<std::pair<boost::function<boost::msm::back::HandledEnum()>, bool> > >]':
main.cpp:271:27: required from here
/usr/local/include/boost/msm/back/state_machine.hpp:1346:40: error: 'struct boost::msm::back::state_machine<player_>::deferred_msg_queue_helper<boost::msm::back::state_machine<player_>, int>' has no member named 'm_deferred_events_queue'
return m_deferred_events_queue.m_deferred_events_queue;
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
...