title: Overloading function call operator in C#
body: <p>Is it possible to overload the default function operator (the () operator) in C#? If so - how? If not, is there a workaround to create a similar affect?</p>
  <p>EDIT:<br />
  I'm trying to give a class a default operator, something along the lines of:</p>
  <pre><code>class A {
      A(int myvalue) {/*save value*/}
  
      public static int operator() (A a) {return a.val;}
      ....
     }
  
  ...
  A a = new A(5);
  Console.Write(A());
  </code></pre>
  <p>EDIT 2:<br />
  I've read the spec and I understand there's no <strong>straight forward</strong> way to do this. I was hoping there's a workaround.</p>
  <p>EDIT 3:
  The motivation is to make a class, or an instance behave like a function, to make a convenient logging interface. By the way, this is doable and reasonable in C++.</p>