title: Class member function pointer
body: <p>I'm trying to use a class function (interrupt service routine),</p>
  
  <pre><code>void (ClassName::*fp)(void)=ClassName::FunctionName;
  </code></pre>
  
  <p>and attaching it to an Arduino interrupt pin using the function with the following type inputs but that doesn't work.</p>
  
  <pre><code>void attachInterrupt(int, void (*)(void),int);
  </code></pre>
  
  <p>How can I make this happen? The interrupt service routine (ISR) needs to access privat object data, so I can't make a function outside of the class. </p>
  
  <p>My compiler error:</p>
  
  <pre><code>ClassName.cpp : : In constructor 'ClassName::ClassName()':
  ClassName.cpp : *)()'
  ClassName.cpp : *)()' to 'void (*)()' for argument '2' to 'void attachInterrupt(uint8_t, void (*)(), int)'
  </code></pre>
  
  <p>Note: I am looking for a solution inside the class and will accept the answer that shows me a solution or shows me it's not possible.</p>