title: Accessing a class template parameter type inside a member function with a lambda fails
body: <p>I have a class template with a member function that has a lambda which wants to use a class template parameter type. It fails to compile inside the lambda but succeeds, as anticipated, outside the lambda.</p>
  
  <pre><code>struct wcout_reporter
  {
      static void report(const std::wstring&amp; output)
      {
          std::wcout &lt;&lt; output &lt;&lt; std::endl;
      }
  };
  
  template &lt;typename reporter = wcout_reporter&gt;
  class agency
  {
  public:
  
      void report_all()
      {
          reporter::report(L"dummy"); // Compiles.
  
          std::for_each(reports_.begin(), reports_.end(), [this](const std::wstring&amp; r)
          {
              reporter::report(r);    // Fails to compile.
          });
      }
  
  private:
  
      std::vector&lt;std::wstring&gt; reports_;
  };
  
  int wmain(int /*argc*/, wchar_t* /*argv*/[])
  {
      agency&lt;&gt;().report_all();
  
      return 0;
  }
  </code></pre>
  
  <p>The compilation error:</p>
  
  <pre><code>error C2653: 'reporter' : is not a class or namespace name
  </code></pre>
  
  <p>Why can't I access the class template parameter type inside the member function lambda?</p>
  
  <p>What do I need to do to gain access to the class template parameter type inside the member function lambda?</p>