title: function pointers and return type conversions
body: <p>Suppose I have a function that performs some side effect and then returns an answer:</p>
  
  <pre><code>int foo()
  {
      perform_some_side_effect();
      return 42;
  }
  </code></pre>
  
  <p>I want to bind <code>foo</code> to a function pointer, but I'm not interested in the answer, just the side effect:</p>
  
  <pre><code>void (*bar)() = foo;
  </code></pre>
  
  <p>However, this appears to be a type error:</p>
  
  <pre><code>error: invalid conversion from ‘int (*)()’ to ‘void (*)()’
  </code></pre>
  
  <p>What is the rationale behind that error? Why doesn't the type system allow me to ignore the answer?</p>
  
  <hr>
  
  <p>On a side note, it works if I wrap the function pointer in a <code>std::function</code>:</p>
  
  <pre><code>std::function&lt;void()&gt; baz = foo;
  </code></pre>
  
  <p>How does <code>std::function</code> (apparently) manage to circumvent this restriction in the type system?</p>