title: Is it safe to assign nullptr to a function pointer variable?
body: <p>I created a function that accepts a function pointer, e.g.</p>
  
  <pre><code>typedef CString(*GetLabelFunc)(const CSomeObject* const pObject);
  
  void DoSomething(GetLabelFunc funcGetLabel);
  </code></pre>
  
  <p>The function may receive a null pointer and will return an empty string in that case. This works perfectly fine in MSVC++ 2010 when using NULL and nullptr as parameter as well - but I do not consider a successful compilation a safe harbor in such special cases ...</p>
  
  <p>Now I wondered if passing <code>nullptr</code> is equivalent to <code>NULL</code> for function pointers. The reason why I am asking is that for instance <code>void*</code> does not accept function pointers (or it least it should not be used). So maybe there is a similar reason that nullptr should not be used for function pointers - meaning is it designed to work for object pointers only?</p>