Thursday 28 December 2017

c++ - Namespace + functions versus static methods on a class

Let's say I have, or am going to write, a set of related
functions. Let's say they're math-related. Organizationally, should
I:




  1. Write these functions
    and put them in my MyMath namespace and refer to them via
    MyMath::XYZ()

  2. Create a class
    called MyMath and make these methods static and refer to the
    similarly
    MyMath::XYZ()




Why
would I choose one over the other as a means of organizing my
software?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...