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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:50:38+00:00 2026-05-27T02:50:38+00:00

I am using the following methods: boost::asio::streambuf io_bufstream; boost::asio::async_read_until(socket_, io_bufstream, </message>, strand_.wrap( boost::bind(&Connection::handleRead, shared_from_this(),

  • 0

I am using the following methods:

boost::asio::streambuf io_bufstream;

boost::asio::async_read_until(socket_, io_bufstream, "</message>", 
    strand_.wrap(
    boost::bind(&Connection::handleRead, shared_from_this(),
    boost::asio::placeholders::error,
    boost::asio::placeholders::bytes_transferred)));//warning: line 36


boost::array<char, 8192> buffer_    
socket_.async_read_some(boost::asio::buffer(buffer_),
    strand_.wrap(
    boost::bind(&Connection::handleRead, shared_from_this(),
    boost::asio::placeholders::error,
    boost::asio::placeholders::bytes_transferred))); // warning

I get the following warning:

C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_recv_op.hpp(58) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)

Here is the complete output as well:

C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_recv_op.hpp(58) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
        C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_recv_op.hpp(48) : while compiling class template member function 'bool boost::asio::detail::reactive_socket_recv_op_base::do_perform(boost::asio::detail::reactor_op *)'
        with
        [
            MutableBufferSequence=boost::asio::mutable_buffers_1
        ]
        C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_recv_op.hpp(71) : see reference to class template instantiation 'boost::asio::detail::reactive_socket_recv_op_base' being compiled
        with
        [
            MutableBufferSequence=boost::asio::mutable_buffers_1
        ]
        C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_service_base.hpp(227) : see reference to class template instantiation 'boost::asio::detail::reactive_socket_recv_op' being compiled
        with
        [
            MutableBufferSequence=boost::asio::mutable_buffers_1,
            Handler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>
        ]
        C:\dev\sapphire\boost_1_46_1\boost/asio/stream_socket_service.hpp(263) : see reference to function template instantiation 'void boost::asio::detail::reactive_socket_service_base::async_receive(boost::asio::detail::reactive_socket_service_base::base_implementation_type &,const MutableBufferSequence &,boost::asio::socket_base::message_flags,Handler)' being compiled
        with
        [
            MutableBufferSequence=boost::asio::mutable_buffers_1,
            ReadHandler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>,
            Handler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>
        ]
        C:\dev\sapphire\boost_1_46_1\boost/asio/basic_stream_socket.hpp(708) : see reference to function template instantiation 'void boost::asio::stream_socket_service::async_receive(boost::asio::detail::reactive_socket_service::implementation_type &,const MutableBufferSequence &,boost::asio::socket_base::message_flags,ReadHandler)' being compiled
        with
        [
            Protocol=boost::asio::ip::tcp,
            MutableBufferSequence=boost::asio::mutable_buffers_1,
            ReadHandler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>
        ]
        ..\..\..\platform_epi\src\connection.cpp(36) : see reference to function template instantiation 'void boost::asio::basic_stream_socket::async_read_some>(const MutableBufferSequence &,ReadHandler)' being compiled
        with
        [
            Protocol=boost::asio::ip::tcp,
            Dispatcher=boost::asio::io_service::strand,
            Handler=boost::_bi::bind_t,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>,
            MutableBufferSequence=boost::asio::mutable_buffers_1,
            ReadHandler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>
        ]

From my understanding is that the error comes from line 36 but I don’t understand what is happening. I think it has something to do with the bytes_transferred being used as a bool when it is int. If anyone could clarify on this issue and/or how to fix it, it would be superb!

Thanks!

  • 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-27T02:50:39+00:00Added an answer on May 27, 2026 at 2:50 am

    This is a Visual Studio-specific warning, and it’s being emitted from Boost’s code, not yours. It can be ignored in most cases. If you want to disable it, use the appropriate pragma.

    #pragma warning(disable: 4800)
    

    It may have been fixed in the latest Boost.ASIO version. I have 1.47 installed and the line in question doesn’t emit this warning.

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

Sidebar

Related Questions

I am trying to pass a function pointer using boost::bind. void Class::ThreadFunction(Type(*callbackFunc)(message_type::ptr&)) { }
What is the difference between the following methods for sending an outbound message using
I am using the following methods: public void M1(Int32 a) { // acquire MyMutex
I have an .aspx file that outputs an image using the following methods: Server.MapPath(somefile.png)
I have parsed XML using both of the following two methods... Parsing the XmlDocument
I have following LINQ statement and I want to rewrite it using extension methods.
Using ASP.net, what methods can I use to do the following: Open up a
Consider the following .Net ASMX web service with two web methods. using System; using
How do I expose the following class using Boost.Python? class C { public: static
I am trying to read 2 arraylists using the following methods. public static ArrayList<Contestant>

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.