Why using 0 as default non type template parameter for void* is not allowed
<p>Why does the following code fail to compile?  Even though it is legal to do <code>void* ptr = 0;</code></p>

<pre><code>template &lt;void* ptr = 0&gt;
void func();

int main() {
    func();
    return 0;
}
</code></pre>

<p>I ask because I found that a very trusted source did something similar and it failed to compile on my machine</p>

<p><strong>NOTE</strong> Should have posted the compiler error along with my question so here it is</p>

<pre><code>so_test.cpp:1:23: error: null non-type template argument must be cast to template parameter type 'void *'
template &lt;void* ptr = 0&gt;
                      ^
                      static_cast&lt;void *&gt;( )
so_test.cpp:1:17: note: template parameter is declared here
template &lt;void* ptr = 0&gt;
                ^
so_test.cpp:5:5: error: no matching function for call to 'func'
    func();
    ^~~~
so_test.cpp:2:6: note: candidate template ignored: substitution failure [with ptr = nullptr]: null non-type template argument must be cast to template parameter type 'void *'
void func();
     ^
</code></pre>