title: Work around incomplete type in static assert
body: <p>Is there a way to static_assert inside a class when the expression depends on the class type itself? Maybe delay the evaluation until the type is complete or after template instantiation?</p>
  
  <p>Example code:</p>
  
  <pre><code>#include &lt;type_traits&gt;
  
  template&lt;typename T&gt;
  struct Test {
     T x = 0; // make non-trivial
     static_assert(std::is_trivial&lt;Test&lt;T&gt;&gt;::value, "");
  };
  
  int main() {
      // would like static assert failure, instead get 'incomplete type' error
      Test&lt;int&gt; test1;
      Test&lt;float&gt; test2;
      return 0;
  }
  </code></pre>