title: Monitor<T> class implementation in c++11 and c++03?
body: <p>Herb Sutter describes implementation of template Monitor class in "C++ and Beyond 2012: Herb Sutter - C++ Concurrency":</p>
  
  <pre><code>template&lt;class T&gt; class monitor {
  private:
       mutable T t;
       mutable std::mutex m;
  public:
       monitor( T t_ ) : t( t_ ) { }
  
       template&lt;typename F&gt;
       auto operator()( F f ) const -&gt; decltype(f(t))
       {  std::lock_guard&lt;mutex&gt; hold{m};  return f(t);  }
  };
  </code></pre>
  
  <p>I am trying to wrap my existing class Logger:</p>
  
  <pre><code>Logger logger;
  monitor&lt; Logger &gt; synchronizedLogger( logger ) ;
  </code></pre>
  
  <p>I have two questions.
  Why does this code do not compile in Visual Studio 2012 with c++11?
  Compiler says that " 'Debug' : is not a member of 'monitor' ", where Debug is a method of Logger class.</p>
  
  <p>How to implement the same monitor template class with C++03 compiler using Boost library.</p>