Ticket #5786: Properly handle cv-qualified member pointers as template parameter

Hi,

This patch ensures that we handle pointers to cv-qualified functions as template parameters, which fixes the ticket. Thanks to consider merging.

Cheers,
  Simon