title: Possible to implement is_pod type trait in C++03 using SFINAE?
body: <p>According to "<a href="https://stackoverflow.com/questions/20181702/which-type-traits-cannot-be-implemented-without-compiler-hooks">Which &lt;type_traits&gt; cannot be implemented without compiler hooks?</a>", it's not possible to implement is_pod in C++03 without compiler intrinsics.  I thought of a possible way, though: C++03 does not allow unions that have members with a nontrivial constructor.  Is it possible to use SFINAE to detect this without throwing a compiler error?</p>
  
  <p>I tried the following and many variants, and couldn't get it to work.  It always either throws an error or returns invalid answers.</p>
  
  <pre><code>#include &lt;cstdio&gt;
  
  template &lt;typename T&gt;
  class is_pod
  {
    template &lt;typename U, void (U::*)()&gt; struct Check;
    template &lt;typename U&gt; union Union { U u; void member(); };
    template &lt;typename U&gt; static char func(Check&lt;Union&lt;U&gt;, &amp;Union&lt;U&gt;::member&gt; *);
    template &lt;typename U&gt; static char (&amp;func(...))[2];
  public:
    enum { value = sizeof(func&lt;T&gt;(0)) == sizeof(char) };
  };
  
  struct Meow { };
  
  struct Purr { Purr() { } };
  
  int main()
  {
    std::printf("%d\n", is_pod&lt;Meow&gt;::value);
    std::printf("%d\n", is_pod&lt;Purr&gt;::value);
    return 0;
  }
  </code></pre>