I think the cleanest way is re-opening the namespace, and I've got the arguments to support it:
- with your second option, with the
using directive, it isn't clear that you're implementing a method in that namespace. You could as well be implementing a free function that uses something from the namespace.
- the third option is usually used for implementing class member functions. If you look directly in the
cpp file, it isn't clear that you're implementing a function from a namespace unless you know that namespace exists. The first thing that comes to mind is that you're implementing a class member function.
- the first one is the clearest. You open the namespace and define a function inside it. The function is part of the namespace, and this is the implementation.