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 7920783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:20:37+00:00 2026-06-03T16:20:37+00:00

I am using boost::signals2::signals in a component, UpdateComponent . A specific aggregate for this

  • 0

I am using boost::signals2::signals in a component, UpdateComponent. A specific aggregate for this component is of type Updateable. I would like Updateable to be able to connect to UpdateComponent‘s boost::signals2::signal. I should note that the Updateable‘s slot is pure-virtual.

Below is a concrete example of the code:

// This is the component that emits a boost::signals2::signal.
class UpdateComponent {
    public:
        UpdateComponent();
        boost::signals2::signal<void (float)> onUpdate; // boost::signals2::signal
}

At some point in UpdateComponent‘s code, I perform onUpdate(myFloat); I believe this is akin to “firing” the boost::signals2::signal to all of its “listeners”.

// The is the aggregate that should listen to UpdateComponent's boost::signals2::signal
class Updateable {
    public:
        Updateable();
    protected:
        virtual void onUpdate(float deltaTime) = 0; // This is the pure-virtual slot that listens to UpdateComponent.
        UpdateComponent* m_updateComponent;
}

In Updateable‘s constructor, I do the following:

Updateable::Updateable {
    m_updateComponent = new UpdateComponent();
    m_updateComponent->onUpdate.connect(&onUpdate);
}

I receive the following two errors:

  1. ...Updateable.cpp:8: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. Say '&BalaurEngine::Traits::Updateable::onUpdate' [-fpermissive]
  2. /usr/include/boost/function/function_template.hpp:225: error: no match for call to '(boost::_mfi::mf1<void, BalaurEngine::Traits::Updateable, float>) (float&)'

I should mention I am using Qt in conjunction with boost. However, I have added CONFIG += no_keywords to my .pro file, so the two should be work together smoothly, as outlined on the boost website. The reason I don’t use Qt’s signals and slots (which works very well) is: I do not want Updateable to be a QObject.

If someone could help me figure out why I am getting an error, it would be greatly appreciated!

  • 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-06-03T16:20:39+00:00Added an answer on June 3, 2026 at 4:20 pm

    The slot you are passing to connect must be a functor. To connect to a member function, you can use either boost::bind or C++11 lambda. For example using lambda:

    Updateable::Updateable {
        m_updateComponent = new UpdateComponent();
        m_updateComponent->onUpdate.connect(
            [=](float deltaTime){ onUpdate(deltaTime); });
    }
    

    or using bind:

    Updateable::Updateable {
        m_updateComponent = new UpdateComponent();
        m_updateComponent->onUpdate.connect(
            boost::bind(&Updateable::onUpdate, this, _1));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I haven't been able to remove compile errors using boost::signals. Any idea would be
I'm using boost::asio, and I have code like this: void CServer::Start(int port) { tcp::acceptor
I'm using boost::signals and leaking memory when I try to connect multiple signals to
I've started using boost::signals2 instead of my old signals-code. I'm having a problem with
I am using boost::multi_index with a data type I'd like to index based on
I am using boost::filesystem to copy a directory recursively. I would like to exclude
I'm using boost (signals + bind) and c++ for passing function reference. Here is
Using boost::program_options, I can not get my own option type to compile when it
I am using boost::signals2 under Red Hat Enterprise Linux 5.3. My signal creates an
I am using boost graph of type: namespace boost { struct computable_object_t { typedef

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.