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

  • Home
  • SEARCH
  • 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 48911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:21:15+00:00 2026-05-10T16:21:15+00:00

Without spending a long time reviewing the boost source code, could someone give me

  • 0

Without spending a long time reviewing the boost source code, could someone give me a quick rundown of how boost bind is implemented?

  • 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. 2026-05-10T16:21:16+00:00Added an answer on May 10, 2026 at 4:21 pm

    I like this piece of the bind source:

    template<class R, class F, class L> class bind_t { public:      typedef bind_t this_type;      bind_t(F f, L const & l): f_(f), l_(l) {}  #define BOOST_BIND_RETURN return #include <boost/bind/bind_template.hpp> #undef BOOST_BIND_RETURN  }; 

    Tells you almost all you need to know, really.

    The bind_template header expands to a list of inline operator() definitions. For example, the simplest:

    result_type operator()() {     list0 a;     BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0); } 

    We can see the BOOST_BIND_RETURN macro expands to return at this point so the line is more like return l_(type...).

    The one parameter version is here:

    template<class A1> result_type operator()(A1 & a1) {     list1<A1 &> a(a1);     BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0); } 

    It’s pretty similar.

    The listN classes are wrappers for the parameter lists. There is a lot of deep magic going on here that I don’t really understand too much though. They have also overloaded operator() that calls the mysterious unwrap function. Ignoring some compiler specific overloads, it doesn’t do a lot:

    // unwrap  template<class F> inline F & unwrap(F * f, long) {     return *f; }  template<class F> inline F & unwrap(reference_wrapper<F> * f, int) {     return f->get(); }  template<class F> inline F & unwrap(reference_wrapper<F> const * f, int) {     return f->get(); } 

    The naming convention seems to be: F is the type of the function parameter to bind. R is the return type. L tends to be a list of parameter types. There are also a lot of complications because there are no less than nine overloads for different numbers of parameters. Best not to dwell on that too much.

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

Sidebar

Ask A Question

Stats

  • Questions 70k
  • Answers 70k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Consider using symbolic links. I have a ~/work/ directory where… May 11, 2026 at 12:57 pm
  • added an answer Did you use tiny_impdef.exe to create a .def file for… May 11, 2026 at 12:57 pm
  • added an answer You would need to write the condition out everytime you… May 11, 2026 at 12:57 pm

Related Questions

How can I test sending email from my application without flooding my inbox? Is
Without the use of any external library, what is the simplest way to fetch
Without getting a degree in information retrieval, I'd like to know if there exists
Without calculating them , I mean?
I challenge you :) I have a process that someone already implemented. I will
Ok, here's one for the JavaScript gurus: In my app, one of the controllers
Recently, I read an article entitled SATA vs. SCSI reliability . It mostly discusses
I have a website running a basic ASP.NET application that is mostly used from

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.