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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:48:13+00:00 2026-05-15T18:48:13+00:00

I have a class which contains boost::function as one of its arguments. I have

  • 0

I have a class which contains boost::function as one of its arguments. I have to make this class equality comparable but the boost::function is not equality comparable. Is there a easy workaround for this problem?

Thanks,
Gokul.

  • 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-15T18:48:14+00:00Added an answer on May 15, 2026 at 6:48 pm

    boost::function is not eq_compare because there is good way to handle the fact that many functors are not eq_compare. Here is a bit of insight into it: http://www.boost.org/doc/libs/1_35_0/doc/html/function/faq.html#id690470

    Unfortunately, the boosties decided not to provide a policy-based approach which would allow us to select the alternative, i.e. “eq-comparable functors only or bust” implementation, leaving us a bit stuffed here. There might be a couple of crappy workarounds for this situation but I’d suggest to either:

    1. ditch boost::function altogether and roll your own if you really,really need this eq_comparable thing.
      or
    2. See if your problem can be solved in a very different way. For example many people use function<> to implement a kind of event system. If that’s the case, then you should have a look at boost::signals.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have class like this below shown. which contains the shopping items where the
I have one class which contains two more classes like hierarchy. When I'm displaying
I have a class which contains a few boost::numeric::ublas::matrix's within it. I would like
I have a template class, inside which i have a normal function. But i
so i have a class which contains basic stuff like Class Test{ public function
I have a class which contains this method /** * Uses the native RegExp
if i have for example class A which contains the functions: //this is in
I have a base class which contains an abstract/MustInherit method. I want this method
I have a class which contains a static collection that can be used across
I have a class which contains 5 properties. If any value is assingned to

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.