C++: How to design a utility class?

后端 未结 5 424
你的背包
你的背包 2021-01-03 00:33

But I don\'t know if I should go for static methods, just a header, a class, or something else?

What would be best practice? But, I don\'t want to have an instance o

5条回答
  •  旧巷少年郎
    2021-01-03 01:26

    Don't put them in a class; just make them non-member functions at namespace scope.

    There's no rule that says every function has to be a member function of some class.

提交回复
热议问题