Pointers to Member Functions

Hello everybody,

I posted it many topics and I'm sorry if someone think that I'm abusing but I really want that my posts are acceptable and readable. As it my english is absolutely bad.

So, I'm waiting some criticisms about it. If you think I should explain something else, or what I explained is bad or a fail. Please told me.

Think that I did an itrodution, so the topic shouldn't go much deeper.

http://surprising-code.blogspot.com/2012/02/pointers-to-member-functions.html

Thank you very much!!!
Those aren't member functions.
1
2
3
4
class foo{
public:
  T this_is_a_member_function();
};


I think that using 'apply' against an array will be more interesting (like std::accumulate)

return (a%2)? false : true; Don't do that. It's obfuscated.
You already have a boolean value in the condition, use that return a%2 == 0;
There is also another issue, that function is not partial order. If both arguments are even, it will return true
So a<b and b<a (that can't happen).


1
2
3
bool isPair (int a, int b){ //terrible name you choose there
        return a>b? true : false; //...
}



Also, you delayed too much the use of typedef
Thank you guy


return (a%2)? false : true;
You are right. I don't know why lately I can't stop to use this type of syntaxis.

Those aren't member functions.

True. But, in fact, I haven't fisnish the article. However, thanks.

Updated!
Topic archived. No new replies allowed.