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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:58:25+00:00 2026-06-18T12:58:25+00:00

I am using boost::asio::steady_timer _timer , but I found if using -std=c++11 flag, compiler

  • 0

I am using boost::asio::steady_timer _timer, but I found if using -std=c++11 flag, compiler will report error of can not convert type at:

boost::asio::steady_timer::time_point now() {
    return boost::asio::steady_timer::clock_type::now();
}

and no match function for operator+() at:

_timer.expires_at(now()+boost::chrono::milliseconds(100));

It seems the compiler can not deduce the correct type in c++11 mode. But instead I using

boost::asio::basic_waitable_timer<boost::chrono::steady_clock> _timer;

and change boost::asio::steady_timer::time_point
to
boost::chrono::steady_clock::time_point

It is OK. However, they are same thing and work fine in g++ without 0x or 11 mode.

Is C++11 do something different thing about typedef deduce? Or a boost config problem?

  • 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-18T12:58:27+00:00Added an answer on June 18, 2026 at 12:58 pm

    The basic_waitable_timer class can work with std::chrono or boost::chrono. On a recent g++, it uses std::chrono by default. To force using boost::chrono, define BOOST_ASIO_DISABLE_STD_CHRONO.

    This is documented here

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

Sidebar

Related Questions

The following code using boost::asio will not compile: #ifndef _SERVER_H_ #define _SERVER_H_ #include Connection.h
I have successfully implemented a network application in visual CLR project using boost.asio. but
Unlike this question: Linker Error while building application using Boost Asio in Visual Studio
Below is my sample code for socket server using boost asio. This server will
I'm using Boost ASIO sockets for communicating with some remote devices under linux, but
I am configuring serial port using boost asio. but why below code is giving
I am trying to create a limited thread pool class using boost::asio. But I
I have a problem, i use boost::asio for my server listener implementation, but using
I am reimplementing an old network layer library, but using boost asio this time.
How can I listen to two socket simultaneously using boost::asio? I think there shouldn't

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.