title: C++ template function taking template class as parameter
body: <p>I'm struggling with the following code. Basically, I have a class Foo and nested class Bar, and now I want to pass a pointer of class Bar object to a function, but it doesn't compile. Could anyone help me with this? Thank you.</p>
  
  <pre><code>template &lt;typename T&gt;
  struct Foo
  {
      struct Bar
      {
          T data_;
      };
      Bar bar_;
  };
  
  template &lt;typename T&gt;
  void func(Foo&lt;T&gt;::Bar* bar) // Why is this line wrong???
  {
  }
  
  int main()
  {
      Foo&lt;int&gt; foo;
      foo.bar_.data_ = 17;
      func(&amp;foo.bar_);
      return 0;
  }
  </code></pre>