Commands: ensure the CommandDef is not messed up by copying
...better make it noncopyable to enforce the builder-style use. In the recent test, I observed strange behaviour when erroneously passing the CommandDef by value; the command seemed to be registered just fine, but afterwards, the registry was empty. I must admit I don't understand this, just from reading the code in CommandDef and Command it should work just fine to activate a copy of the originally started CommandDef; anyway, I didn't care to track that issue down, rather make the CommandDef noncopyable as it should have been right from start.
This commit is contained in:
parent
de7b9f87ed
commit
27c2f843da
1 changed files with 3 additions and 1 deletions
|
|
@ -71,6 +71,7 @@
|
|||
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
|
||||
|
||||
|
|
@ -276,7 +277,8 @@ namespace control {
|
|||
*
|
||||
*/
|
||||
class CommandDef
|
||||
: public lib::BoolCheckable<CommandDef>
|
||||
: public lib::BoolCheckable<CommandDef
|
||||
, boost::noncopyable >
|
||||
{
|
||||
Symbol id_;
|
||||
Command prototype_;
|
||||
|
|
|
|||
Loading…
Reference in a new issue