My question is regarding the use of anonymous namespaces for organizing my code in a class.
Earlier whenever I needed some utility method, which performed some internal computation, I added a private method in the class, did the computation and used the result.
Now, instead of adding a private method to the class, I implement the same computation in the class source as a function inside an anonymous namespace, pass the required data and fetch the result. I started this practice after having read here that even private methods of a class are part of its interface and non member functions improve the encapsulation of a class.
Which of these approaches is better?