What is the use of private static member functions?

前端 未结 5 2063
一生所求
一生所求 2021-01-31 07:37

I was looking at the request parser from the boost::asio example and I was wondering why the private member functions like is_char() are static? :

5条回答
  •  难免孤独
    2021-01-31 08:25

    The point isn't where it is used. The question is what it uses. If its definition doesn't use any nonstatic members, I would make the function static, according to the same principle that I wouldn't pass a redundant parameter to any function (unless they were to be used in overload resulion)

提交回复
热议问题