
-----------------------------------
wtd
Sun Jul 16, 2006 10:12 am

Something important C++ is missing
-----------------------------------
Yet another language comparison.  I'm going to look at something you should realize and appreciate that C++ lacks; something it very much should have.

In C++ we can create functions which have parameters with default values.  However, if we wish to do something different in the body of the function, depending on whether or not the function was called with the argument provided, we must avoid using that feature entirely and instead use function overloading.

We cannot rely on testing to see if the provided argument equals the default value for that parameter.  The programmer who used the function might call it with that value explicitly.

Ironically it's an older language that provides this greater functionality.  Let's compare some Common Lisp and C++.

void foo()
{
   cout 