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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:37:59+00:00 2026-06-07T21:37:59+00:00

I am having an issue compiling this piece of code error /usr/include/boost/bind/bind_mf_cc.hpp:91:5: error: initializing

  • 0

I am having an issue compiling this piece of code error

/usr/include/boost/bind/bind_mf_cc.hpp:91:5: error: initializing argument 5 of ‘boost::_bi::bind_t, typename boost::_bi::list_av_4::type> boost::bind(R (T::*)(B1, B2, B3), A1, A2, A3, A4) [with R = void; T = tcpReader; B1 = const boost::system::error_code&; B2 = unsigned int; B3 = boost::asio::basic_streambuf<>&; A1 = tcpReader*; A2 = boost::system::error_code; A3 = unsigned int; A4 = boost::asio::basic_streambuf<>; typename boost::_bi::list_av_4::type = boost::_bi::list4, boost::_bi::value, boost::_bi::value, boost::_bi::value > >]

void tcpReader::handle_read(const boost::system::error_code& ec, std::size_t bytes_transferred, boost::asio::streambuf& buf)
// inside a class method
boost::asio::streambuf buf;
boost::asio::async_read_until(*sock,buf,"\n" ,
                              boost::bind(&tcpReader::handle_read,this,error,buf.size(),buf)
                              );

Any ideas on what the problem is ? It I know I am missing something simple but I cannot figure it out is it something like I will have to use boot::buffer ?

Thanks in advance

  • 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-07T21:38:01+00:00Added an answer on June 7, 2026 at 9:38 pm

    To me it looks like, that all overloads of async_read_until() takes 2 arguments. You pass a function with 3 arguments. Likely you want to pass the stream as extra parameter, bind it to the function to get a function with 2 arguments.

    boost::bind( &tcpReader::handle_read, this, _1, _2, boost::ref( buf ) )
    

    Will “convert” your member function to something, that takes 2 arguments. The boost::ref() wraps your buffer as reference, otherwise a copy would be made.

    Kind regards
    Torsten

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

Sidebar

Related Questions

I am having issues getting this piece of code to compile. I am compiling
Having an issue where compiling some code that makes use of HttpContextBase is throwing
I'm having a small issue when I'm compiling a template with Handlebars.js . I
Hi guys I am having issue I have this query: SELECT * FROM useraccount
So I'm having issues with some code that I've inherited. This code was building
Brief version of my question: This code crashes the compiler. pThread[0] = new boost::thread(
Our build person was having issues compiling some source code that is checked into
I'm having an issue compiling (make) ruby on Mac Osx . I get the
after weeks of having this issue I finally decided to ask for a solution
i'm having a issue with the T4 templates for generating code. I'm wondering if

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.