title: sizeof derived already from base
body: <p>is it possible to return the <em>sizeof</em> a derived class already from base class/struct?  </p>
  
  <p>imho the size of a class is a kind of property of itself, like the weight of a human being. But I don't want to write the same function in every class.</p>
  
  <p>many thanks in advance<br>
  Oops
  PS: so code to make my question more clear:</p>
  
  <pre><code>template &lt;typename T&gt;
  struct StructBase {
      size_t size&lt;T&gt;(){
          return sizeof(T);
      }
  };
  
  struct MyStruct: public StructBase&lt;MyStruct&gt; {
      double d1;
      double d2;
      double d3;
      MyStruct(): d1(0), d2(0), d3(0){}
      //I do not want to do this here
      //size_t size(){ //return size&lt;MyStruct&gt; ;}
  };
  
  int main(void) {
     MyStruct m;
     std::cout &lt;&lt; m.size(); //nop ?!?
  }
  </code></pre>