www.digitalmars.com         C & C++   DMDScript  

c++.beta - illegal cast (template function with default parameter)

template<class T>
void f(const T = T(0))
// Error: illegal cast
// from: int
// to  : T
{ }

int main()
{
  f(0);
  f<int>();
}


Extracted from Boost's format library.


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de

...and what have you contributed to the Net?
Jun 09 2003