Fix sample error: ISO C++ forbids taking the address of a bound member function to form a pointer to member function.

This commit is contained in:
terik23 2018-03-18 20:32:55 +05:00
parent c460858d85
commit 30b5aedae8

View file

@ -76,7 +76,7 @@ int main() {
std::cout << NAMEOF(~intValue) << std::endl; // intValue std::cout << NAMEOF(~intValue) << std::endl; // intValue
std::cout << NAMEOF(!intValue) << std::endl; // intValue std::cout << NAMEOF(!intValue) << std::endl; // intValue
std::cout << NAMEOF(someVar.SomeMethod1()) << std::endl; // SomeMethod1() std::cout << NAMEOF(someVar.SomeMethod1()) << std::endl; // SomeMethod1()
std::cout << NAMEOF(&someVar.SomeMethod2) << std::endl; // SomeMethod2 std::cout << NAMEOF(&SomeStruct::SomeMethod2) << std::endl; // SomeMethod2
std::cout << NAMEOF(SomeMethod3) << std::endl; // SomeMethod3 std::cout << NAMEOF(SomeMethod3) << std::endl; // SomeMethod3
std::cout << NAMEOF_TYPE(int[]) << std::endl; // int[] std::cout << NAMEOF_TYPE(int[]) << std::endl; // int[]
@ -84,7 +84,7 @@ int main() {
std::cout << NAMEOF_TYPE(Long::LL) << std::endl; // LL std::cout << NAMEOF_TYPE(Long::LL) << std::endl; // LL
std::cout << NAMEOF_FUN(someVar.SomeMethod1()) << std::endl; // SomeMethod1() std::cout << NAMEOF_FUN(someVar.SomeMethod1()) << std::endl; // SomeMethod1()
std::cout << NAMEOF_FUN(&someVar.SomeMethod2) << std::endl; // SomeMethod2 std::cout << NAMEOF_FUN(&SomeStruct::SomeMethod2) << std::endl; // SomeMethod2
std::cout << NAMEOF_FUN(SomeMethod3) << std::endl; // SomeMethod3 std::cout << NAMEOF_FUN(SomeMethod3) << std::endl; // SomeMethod3
std::cout << NAMEOF_VAR(someVar.SomeField) << std::endl; // SomeField std::cout << NAMEOF_VAR(someVar.SomeField) << std::endl; // SomeField