title: Can I declare a function that can take pointer to itself as an argument?
body: <p>Reading a question in stackoverflow, I wondered whether it's possible to declare a function that takes a pointer to itself.  I.e. to make such declaration of <code>foo</code>, for which the following would be correct:</p>
  
  <pre><code>foo(foo);
  </code></pre>
  
  <p>The simpliest idea is casting to another function pointer (can't cast to <code>void*</code>, since it may be smaller), so the function declaration looks like this:</p>
  
  <pre><code>void foo(void (*)());
  </code></pre>
  
  <p>While that's OK in C (and will work with casting in C++), I wonder, whether it can be done without such hard "reinterpret" casting or losing type information.  </p>
  
  <p>In other words, I want the following declaration:</p>
  
  <pre><code>void foo( void (*)( void (*)( void (*) ( ... ))));
  </code></pre>
  
  <p>but, of course, unlimited declarations are impossible.  Naive <code>typedef</code>ing doesn't help either.</p>
  
  <p>C++ templates are welcome, even if they make the calling code (<code>foo(foo)</code>) look a bit less succinct, but still <em>finite</em>.</p>
  
  <p>C-style answers that show, how one can drop type information without casting, or other tricks of that sort are, of course, interesting, but won't be accepted.</p>