No member named in class
<p>So here's my code</p>

<p>MyClass.h:</p>

<pre><code>namespace ns{
  template &lt;typename A, typename B&gt;
  class MyClass{
    struct MyStruct1;
    struct MyStruct2;

    struct MyStruct1{
      /*not important here*/
    };

    struct MyStruct2{
      MyStruct2(std::weak_ptr&lt;MyStruct1&gt; i1, std::weak_ptr&lt;MyStruct1&gt; i2, B i3):d1{i1}, d2{i2}, d3{i3} {};
      std::weak_ptr&lt;MyStruct1&gt; d1;
      std::weak_ptr&lt;MyStruct1&gt; d2;
      B d3;
    };
    //Compare MyStruct2
    static bool compareMyStruct2(std::weak_ptr&lt;MyStruct2&gt;&amp; e1, std::weak_ptr&lt;MyStruct2&gt;&amp; e2);
  };

  template&lt;typename A, typename B&gt;
  bool MyClass&lt;A, B&gt;::compareMyStruct2(std::weak_ptr&lt;MyStruct2&gt;&amp; e1, std::weak_ptr&lt;MyStruct2&gt;&amp; e2){
    return (e1-&gt;d3 &lt; e2-&gt;d3);
  }
}
</code></pre>

<p>When I build, the compiler is telling me that</p>

<pre><code>No member named 'd3' in 'std::_1::weak_ptr&lt;ns::MyClass::MyStruct2'
</code></pre>

<p>I have no idea why. Any suggestions?</p>