
Josh Quigley <0zeroth <at> gmail.com> writes: Apologies about the formatting snafu. The code should have read: For example, is it possible to achieve something like the following: #include <iostream> #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> void print(const boost::system::error_code& /*e*/) { std::cout << "Hello, world!\n"; } int main() { boost::asio::io_service io; // Possibly another class needed here, or a way of setting the clock to be fake boost::asio::deadline_timer t(io, boost::posix_time::hours(24)); t.async_wait(&print); io.poll(); // Nothing should happen - no handlers ready // PSEUDO-CODE below of what I'd like to happen, jump ahead 24 hours io.set_time(io.get_time() + boost::posix_time::hours(24)); io.poll(); // The timer should go off return 0; }