Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6368351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:39:50+00:00 2026-05-25T00:39:50+00:00

I would like to use is_flag_active() function inside one of my state’s on_entry template

  • 0

I would like to use is_flag_active() function inside one of my state’s on_entry template function:

struct StBladeDown : public msm::front::state<> {
    template<class Event, class FSM>
    void on_entry(Event const& event, FSM& fsm) {
        if(fsm.is_flag_active<FlagMaster>()) { // ERROR
            // doSomeThing();
        }
    }
};

However I got the following compile error:

StOk.hpp: In member function 'void mr::mrd::amfo::StOk_::StBladeDown::on_entry(const Event&, FSM&)':
StOk.hpp:78: error: expected primary-expression before '>' token
StOk.hpp:78: error: expected primary-expression before ')' token

However outside of the state machine, I mean if I first declare a state machine, I can use the is_flag_active:

StAMFODirector backEnd;
backEnd.start();
processEvent(backEnd,EvBladeDown());
processEvent(backEnd,EvMaster());
if(backEnd.is_flag_active<FlagMaster>()){ // OK
    _LOG_DEBUG("Flag Master active");
}

If I use the front_end’s is_flag_ I get compiler error again (no such function in msm::back::state_machine).

Any idea how to use is_flag_active together with on_entry? Or if it is not possible are there any alternatives?

Thanks for any help,
Gabor

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:39:51+00:00Added an answer on May 25, 2026 at 12:39 am

    Try this:

    struct StBladeDown : public msm::front::state<> {
        template<class Event, class FSM>
        void on_entry(Event const& event, FSM& fsm) {
            if (fsm.template is_flag_active<FlagMaster>()) {
                // doSomeThing();
            }
        }
    };
    

    Note the addition of the template keyword. See this FAQ for information about why it’s necessary in this context: What is the ->template, .template and ::template syntax about?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use Date() function in hibernate criteria, since one field is
I would like to use as and is as members of an enumeration. I
What I would like to do is use the elegance of LINQ while maintaining
I would like to use a timeframe selector in a web page, that is
I would like to use ON DUPLICATE KEY UPDATE in Zend Framework 1.5, is
I would like to use conditions in my CSS. The idea is that I
I would like to use a very wide image on my website. There is
I would like to use a SimpleAdapter instead of customizing an ArrayAdapter. Everything is
Our android application is getting fairly big and we would like to use functional
I have a Perl module that I would like to use from Java. Is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.