Adding a wrapper to an overloaded function
- by Cev
Say you had a timestamp function and then wanted to create a new function to combine your timestamp and Console.WriteLine(), e.g.
public static void Write(string msg)
{
WriteTimeStamp();
Console.WriteLine( msg );
}
But the WriteLine() method has 18 or so overloads, which will not be reflected in the signature of the wrapper function. How would you have the wrapper take non-strings and pass them on to WriteLine()?