title: Why can't I inherit from Eigen::Matrix?
body: <p>I have <a href="https://github.com/Kitware/kwiver/blob/957895f35f0d46a6fd572686e10f83415bdb355d/vital/types/point.h#L52" rel="nofollow noreferrer">this</a> class:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template &lt; unsigned N, typename T &gt;
  class MY_EXPORT my_point : protected Eigen::Matrix&lt; T, N, 1 &gt;
  {
  public:
    using vector_type = Eigen::Matrix&lt; T, N, 1 &gt;;
  
    my_point() : vector_type{ vector_type::Zero() } {}
    using vector_type::vector_type;
  };
  </code></pre>
  
  <p>My Linux (GCC) build is fine. However, on Windows (MSVC 15.9.16), I get <a href="https://open.cdash.org/viewBuildError.php?buildid=6180125" rel="nofollow noreferrer">really strange errors</a>:</p>
  
  <pre class="lang-none prettyprint-override"><code>c:\include\eigen3\eigen\src\core\densebase.h(482): error C2338: THIS_METHOD_IS_ONLY_FOR_1x1_EXPRESSIONS (compiling source file c:\code\my_point.cxx) [C:\workspace\KwiverWindows\build\vital\vital.vcxproj]
    c:\include\eigen3\eigen\src\core\densebase.h(481): note: while compiling class template member function 'const float &amp;Eigen::DenseBase&lt;Derived&gt;::value(void) const'
            with
            [
                Derived=Eigen::Matrix&lt;float,4,1,0,4,1&gt;
            ] (compiling source file c:\code\my_point.cxx)
    c:\include\eigen3\eigen\src\core\matrixbase.h(50): note: see reference to class template instantiation 'Eigen::DenseBase&lt;Derived&gt;' being compiled
            with
            [
                Derived=Eigen::Matrix&lt;float,4,1,0,4,1&gt;
            ] (compiling source file c:\code\my_point.cxx)
    c:\include\eigen3\eigen\src\core\plainobjectbase.h(100): note: see reference to class template instantiation 'Eigen::MatrixBase&lt;Derived&gt;' being compiled
            with
            [
                Derived=Eigen::Matrix&lt;float,4,1,0,4,1&gt;
            ] (compiling source file c:\code\my_point.cxx)
    c:\include\eigen3\eigen\src\core\matrix.h(180): note: see reference to class template instantiation 'Eigen::PlainObjectBase&lt;Eigen::Matrix&lt;float,4,1,0,4,1&gt;&gt;' being compiled (compiling source file c:\code\my_point.cxx)
  </code></pre>
  
  <p>It looks like the compiler is trying to instantiate inappropriate methods (e.g. a later error is trying to instantiate <code>w()</code> for a 3-vector). What am I doing wrong? (Why is this not a problem when using <code>Eigen::Matrix</code> directly?)</p>
  
  <p><a href="https://godbolt.org/z/2-Nb7E" rel="nofollow noreferrer">Here</a> is a live demo.</p>