Fixes toString() for function pointers and added support for member function pointers.

- thanks to Malcolm Noyes for supplying sample code on which the solution here was based
This commit is contained in:
Phil Nash 2014-01-07 17:25:27 +00:00
parent 440a47011f
commit e091018514
7 changed files with 82 additions and 12 deletions

View file

@ -356,6 +356,20 @@ TEST_CASE( "Comparing function pointers", "[Tricky][function pointer]" )
REQUIRE( a == &foo );
}
struct S
{
void f() {}
};
TEST_CASE( "Comparing member function pointers", "[Tricky][member function pointer]" )
{
typedef void (S::*MF)();
MF m = &S::f;
CHECK( m == &S::f );
}
class ClassName {};
TEST_CASE( "pointer to class", "[Tricky]" )