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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:33:39+00:00 2026-06-07T15:33:39+00:00

I need to override connection between boost::signals2::signal and boost::function . For this purpose I’ve

  • 0

I need to override connection between boost::signals2::signal and boost::function.
For this purpose I’ve created following template function:

template<typename T>
void bind(boost::signals2::signal<T> &signal, boost::function<T> function) {
  // override code ...
}

I want to make use of this bind as simple as it can be.
From what I’ve read in posts on similar issues, template parameter should be deduced from function arguments.
But in my case when there’s no explicit parameter it’s not working.

boost::signals2::signal<void ()> my_signal;

bind<void ()>(my_signal, boost::bind(&A::func, this)); // this works
bind(my_signal, boost::bind(&A::func, this));          // error: no matching function for call

Am I missing something?
Can there be any workaround to avoid explicit template parameter?

  • 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-07T15:33:40+00:00Added an answer on June 7, 2026 at 3:33 pm

    The second argument type is not std::function<T>, but some bind type, so the compiler is unable to deduce the T for the second function parameter. You need to tell the compiler “You are OK with not finding a type for T in the second function parameter”. This can be done by making the second parameter a non-deduced context.

    template<typename T>
    void bind(boost::signals2::signal<T> &signal, 
              typename std::common_type<boost::function<T>>::type function) {
      // override code ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to override the connection in my new table adapters, as they are
Need a map reduce function by mongo in php This my mongo structure [_id]
I need to override styles for two EditText instances. I have two issues regarding
I need to override an abstract Block in Magento : app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php I need to
I need to override Backbone.sync to allow PUT the problem is i don't know
I need to inherit paramsPrepareParamsStack interceptor stack into mystack and need to override validation
I want to compress the viewstate. Therefore I need to override SavePageStateToPersistenceMedium wich belongs
Need to apply a filter to a file like this: TUPAC_0006:1:1:2554:2356#0/1 0 * 0
I need to modify the content of certain HttpRequests (SSAS connection strings) in IIS.
I've created several master / detail webparts that need to be connected. We have

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.