What is the difference between writing a template in c++ in the below both ways
template & template<
template
These keywords are there because of historical reason. There's no difference between them. Read this: http://blogs.msdn.com/b/slippman/archive/2004/08/11/212768.aspx