title: Confusion about CRTP static polymorphism
body: <p>I'm trying to wrap my head around the CRTP. There are some good sources around, including this forum, but I think I have some confusion about the basics of static polymorphism. Looking at the following Wikipedia entry:</p>
  <pre><code>template &lt;class T&gt; 
  struct Base
  {
      void implementation()
      {
          // ...
          static_cast&lt;T*&gt;(this)-&gt;implementation();
          // ...
      }
  
      static void static_func()
      {
          // ...
          T::static_sub_func();
          // ...
      }
  };
  
  struct Derived : public Base&lt;Derived&gt;
  {
      void implementation();
      static void static_sub_func();
  };
  </code></pre>
  <p>I understand that this helps me to have different implementation() variants in derived classes, kinda like a compile-time virtual function. However, my confusion is that I think I cannot have functions like</p>
  <pre><code>void func(Base x){
      x.implementation();
  }
  </code></pre>
  <p>as I would with normal inheritance and virtual functions, due to Base being templated, but I would have to either specify</p>
  <pre><code>func(Derived x)
  </code></pre>
  <p>or use</p>
  <pre><code>template&lt;class T&gt; 
  func(T x)
  </code></pre>
  <p>So what does CRTP actually buy me in this context, as opposed to simply shadowing/implementing the method straightforward in Derived::Base?</p>
  <pre><code>struct Base
  {
      void implementation();
  };
  
  struct Derived : public Base
  {
      void implementation();
      static void static_sub_func();
  };
  </code></pre>