Advantages of classes with only static methods in C++

前端 未结 8 1672
谎友^
谎友^ 2020-12-01 07:28

Even though there are no static classes in C++, coming from a Java background I use to create a helper class like Util containing only static methods. Is this c

8条回答
  •  既然无缘
    2020-12-01 08:26

    In C++, just make them free functions. There's no need or reason to place them in a class at all. Unless you're doing shizzle with templates.

提交回复
热议问题