title: boost deadline_timer compile issue
body: <p>The following source will not compile using MSVC 12.</p>
  
  <p>IMCThreadMngr.cpp</p>
  
  <pre><code>#include "IMCThreadMngr.h"
  
  
  CIMCThreadMngr::CIMCThreadMngr() : mService(),
  mWork(mService)
  {}
  
  CIMCThreadMngr::~CIMCThreadMngr() {};
  
  
  void CIMCThreadMngr::StopManager()
  {
      std::cout &lt;&lt; "Manager ceasing" &lt;&lt; std::endl;
      mService.stop();
      mServicethread.join();
      std::cout &lt;&lt; "Manager ceased" &lt;&lt; std::endl;
  }
  
  void CIMCThreadMngr::StartManager()
  {
      mServicethread = boost::thread(boost::bind(&amp;boost::asio::io_service::run, &amp;mService));
  }
  
  void CIMCThreadMngr::RegisterThread(const std::string&amp; name, int timeout)
  {
      if (name.length() == 0) {
          std::cout &lt;&lt; "No thread name provided" &lt;&lt; std::endl;
          return;
      }
      boost::mutex::scoped_lock lock(mGroupMutex);
  
      ThreadObject ob = ThreadObject(mService);   
      ob.name_ = name;
      if (timeout &gt; 0) {
      ob.timeout_ = timeout;
      }
      else {
      ob.timeout_ = 2000;
      }
      mThreadGroup.push_back(ob);
  
  }
  
  void CIMCThreadMngr::UnRegisterThread(const std::string&amp; name)
  {
      if (name.length() == 0) {
          std::cout &lt;&lt; "No thread name provided" &lt;&lt; std::endl;
          return;
      }
  
      boost::mutex::scoped_lock lock(mGroupMutex);
  
      std::vector&lt;ThreadObject&gt;::iterator obref;
      if (FindThreadObject(name, obref)){
          mThreadGroup.erase(obref);
      }
  }
  
  void CIMCThreadMngr::ThreadCheckIn(const std::string&amp; name){
  
      if (name.length() == 0) {
          std::cout &lt;&lt; "No thread name provided" &lt;&lt; std::endl;
          return;
      }
  
      boost::mutex::scoped_lock lock(mGroupMutex);
  
      std::vector&lt;ThreadObject&gt;::iterator obref;  
      if (FindThreadObject(name, obref)){
          obref-&gt;timer_.cancel();
          obref-&gt;timer_.expires_from_now(boost::posix_time::seconds(obref-&gt;timeout_));
          obref-&gt;timer_.async_wait(boost::bind(&amp;CIMCThreadMngr::TimeoutElapsed, this));
      }
  }
  
  bool CIMCThreadMngr::FindThreadObject(const std::string name, std::vector&lt;ThreadObject&gt;::iterator&amp; ob){
  
      for (ob = mThreadGroup.begin(); ob != mThreadGroup.end(); ob++) {
          if ((ob-&gt;name_.compare(name) == 0)) {
              return true;
          }
      }
      return false;
  }
  
  void CIMCThreadMngr::TimeoutElapsed(const boost::system::error_code&amp; e, const std::string&amp; name){
  
      boost::mutex::scoped_lock lock(mGroupMutex);
  
      if (e != boost::asio::error::operation_aborted)
      {
          std::cout &lt;&lt; "Thread " &lt;&lt; name &lt;&lt; " did has not responded" &lt;&lt; std::endl; // Timer was not cancelled, take necessary action.
          ThreadCheckIn(name);
      }
  }
  </code></pre>
  
  <p>IMCThreadMngr.h</p>
  
  <pre><code>#include &lt;boost/asio.hpp&gt;
  #include &lt;boost/bind.hpp&gt;
  #include &lt;boost/thread.hpp&gt;
  #include &lt;boost/date_time/posix_time/posix_time.hpp&gt;
  #include &lt;boost/thread/mutex.hpp&gt;
  #include &lt;vector&gt;
  
  
  class CIMCThreadMngr {
  
  public:
  
      struct ThreadObject {
  
          std::string name_;
          int timeout_;
          bool threadrunning_;
          boost::posix_time::ptime lastupdate_;
          boost::asio::deadline_timer timer_;
  
          ThreadObject(boost::asio::io_service&amp; service) : timer_(service)
          {
              timer_.expires_from_now(boost::posix_time::millisec(3000));
          }
  
      };
  
  public:
      CIMCThreadMngr();
      ~CIMCThreadMngr();
  
      void StopManager();
      void StartManager();
  
      void RegisterThread(const std::string&amp; name, int timeout);
      void UnRegisterThread(const std::string&amp; name);
      void ThreadCheckIn(const std::string&amp; name);
      bool FindThreadObject(const std::string name, std::vector&lt;ThreadObject&gt;::iterator&amp; ob);
      void TimeoutElapsed(const boost::system::error_code&amp; e, const std::string&amp; name);   
      void TimeoutElapsed( );
  
  private:
  
      boost::asio::io_service mService;
      boost::asio::io_service::work mWork;
      boost::thread mServicethread;
      std::vector&lt;ThreadObject&gt; mThreadGroup;
      boost::mutex mGroupMutex;
  
  };
  </code></pre>
  
  <p>The compiler issue I am running into is as follows</p>
  
  <pre><code>f:\boost\boost_1_57_0\boost\asio\basic_deadline_timer.hpp(510): error C2248: 'boost::asio::basic_io_object&lt;TimerService,false&gt;::operator =' : cannot access private member declared in class 'boost::asio::basic_io_object&lt;TimerService,false&gt;'
            with
            [
                TimerService=boost::asio::deadline_timer_service&lt;boost::posix_time::ptime,boost::asio::time_traits&lt;boost::posix_time::ptime&gt;&gt;
            ]
            f:\boost\boost_1_57_0\boost\asio\basic_io_object.hpp(164) : see declaration of 'boost::asio::basic_io_object&lt;TimerService,false&gt;::operator ='
            with
            [
                TimerService=boost::asio::deadline_timer_service&lt;boost::posix_time::ptime,boost::asio::time_traits&lt;boost::posix_time::ptime&gt;&gt;
            ]
            This diagnostic occurred in the compiler generated function 'boost::asio::basic_deadline_timer&lt;boost::posix_time::ptime,boost::asio::time_traits&lt;boost::posix_time::ptime&gt;,boost::asio::deadline_timer_service&lt;Time,TimeTraits&gt;&gt; &amp;boost::asio::basic_deadline_timer&lt;Time,TimeTraits,boost::asio::deadline_timer_service&lt;Time,TimeTraits&gt;&gt;::operator =(const boost::asio::basic_deadline_timer&lt;Time,TimeTraits,boost::asio::deadline_timer_service&lt;Time,TimeTraits&gt;&gt; &amp;)'
            with
           [
               Time=boost::posix_time::ptime,            TimeTraits=boost::asio::time_traits&lt;boost::posix_time::ptime&gt;
           ]
  </code></pre>
  
  <p>Hopefully the issue is something fairly straight forward, though I can't find an obvious difference between my code above, and the boost examples of deadline_timer.</p>