【发布时间】:2018-04-08 08:50:14
【问题描述】:
我正在尝试学习 boost 的元状态机 (MSM) 库。
按照http://redboltz.wikidot.com/simple-state-machine中的简单状态机示例,我遇到了一些问题:
-
我在使用
boost::mpl::vector定义状态机的“转换表”时遇到问题。// Transition table struct transition_table:mpl::vector< // Start Event Next Action Guard msmf::Row < State1, Event1, End, msmf::none, msmf::none > > {}; Qt Creator IDE 不会检测并自动完成
mpl::vector(它只识别编号版本,即mpl::vector0/1...)!!!代码可以编译(没有错误),但是当我运行它时它崩溃了(
state_machine_def.hpp的第 203 行,关于 FSM 的转换处理程序)我在带有 Qt 5.9.0 MinGW 32 位编译器的 Windows 7 上使用 Boost 1.66。
我已将 boost 的路径添加到我的包含路径中(因为 MSM 和 MPL 是仅标头库)
问题
Q1 - 为什么我的系统无法识别
boost::mpl::vector?Q2 - 将
mpl::vector替换为mpl::vector1(我的 IDE QtCreator 可以识别)并不能解决我的问题(运行时崩溃)
提醒:上例中的SM只有一个过渡入口。
非常感谢任何帮助
【问题讨论】:
标签: c++ boost qt-creator template-meta-programming state-machine