In functional oriented languages like Haskell, one can overload function definitions an several axis of parameter signature. C++ supports number and type of arguments. Other languages support argument values and even guard clauses (code that tests the arguments for conditions.) For instance the factorial implementation in Haskell:
factorial :: (Integral a) => a -> a
factorial 0 = 1
factorial n = n * factorial (n - 1)
Where the definition for factorial when the argument is 0 differs from the definition for factorial when the argument is any other integer.
I have not found this capability in C++ and thought, at first, that it would be difficult to implement in the language. Further reflection made me think it actually would be fairly easy and a nice addition to the language, so I must be missing it.
Is there any way to do this either in native syntax or templates?