Sorry for asking such a basic question but so far all the examples that I have seen on the net for using the basic deadline timer simply initializes the timer as follows
boost::asio::deadline_timer timer(ioservice);
How do I declare this timer as a part of a class. If I try something like
boost::asio::deadline_timer timer;
Then how do I assign the ioservice object to it?
I dont see an option like timer.ioservice = ioservice
You have to pass a reference to the IO service to the constructor of the surrounding class, and then construct the timer in the constructors initializing list: