unable to be compiled
<pre><code>#include &lt;iostream&gt;
using namespace std;


template &lt; class T &gt;
void swap (T&amp; a, T&amp; b)
{
    T temp = a; 
    a = b;
    b = temp;
}

int main ()
{
    char a = 'a';
    char b = 'b';
    swap (a, b);
    cout &lt;&lt; "a = " &lt;&lt; a &lt;&lt; endl;
    cout &lt;&lt; "b = " &lt;&lt; b &lt;&lt; endl;
    return 0;
}
</code></pre>

<p>the code can not be compiled under linux KDE command line (gcc compiler).
however if I change "using namespace std" into "using std::cout; using std::cin using std::endl" the program can be compiled and run well. what's wrong with it?
Thank you very much</p>
