C++: [VS2010]: warning C4396: 'stdext::hash_value' : the inline specifier cannot be used when a friend declaration
<p>I am converting my VS2005 C++ code to VS2010 code. Unfortunately in VS2010 it is giving compiler warning whereas in VS2005 it compiled smoothly. (FYI: I have set the warning to be treated as errors).</p>

<p>Pls have a look at the code snippet:</p>

<p>The error is at the line where the friend declaration is there.</p>

<pre><code>class __declspec(dllexport) MyKey
{
    friend size_t stdext::hash_value&lt;MyKey&gt;(const MyKey&amp; key);  // compiler warning at this line (pls see below for the actual compiler warning)

    ubit32  m_uKey1;

};
template&lt;&gt; inline size_t stdext::hash_value&lt;MyKey&gt;(const MyKey&amp; key)
{
    return key.m_uKey1;
}
</code></pre>

<p>Here is the compiler warning as shown below:</p>

<pre><code>warning C4396: 'stdext::hash_value' : the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
</code></pre>

<p>Please help to resolve this error for me. Thanks.</p>
