Thursday, November 18, 2010

Function Decay

When an array is implicitly converted to a pointer, it is called decay.

When a function is implicitly converted to a pointer, it is also called decay.

It is called decay, because type information is lost. In this case, the type information that is lost is the types of the arguments.

Reference: C++ Templates: The complete guide by David Vandevoorde and Nicolai M. Josuttis. Addison-Wesley, 2003, p.168

No comments:

Post a Comment