【发布时间】:2011-09-25 15:40:20
【问题描述】:
在使用 Boost.Statechart 实现状态机时,我遇到了一个问题,原因是尝试从其构造函数访问 simple_state 的外部上下文。 simple_state.hpp 中的一条评论告诉我:
// This assert fails when an attempt is made to access an outer
// context from a constructor of a state that is *not* a subtype of
// state<>. To correct this, derive from state<> instead of
// simple_state<>.
除了显然能够从其构造函数访问外部上下文之外,使用state<> 而不是simple_state<> 作为我的状态的基类有什么不同或影响?
【问题讨论】:
标签: c++ state-machine boost-statechart