A common idiom for this is to create a namespace for the "part", which is intended only for internal code:
namespace abc { namespace detail { template<class T> void mysort(std::vector<T>& vec, size_t b, size_t m, size_t e).. } template<class T> void mysort(std::vector<T>& vec)... }
To answer your question about unnamed namespace behavior:
Namespaces (they are not called anonymous namespaces) are called a little strange - they are not named for you, but the compiler does generate a unique internal name for it. Your example is equivalent:
namespace abc { namespace def // lets say 'def' is unique. { template<class T> void mysort(std::vector<T>& vec, size_t b, size_t m, size_t e).. } using namespace def; template<class T> void mysort(std::vector<T>& vec)... }
You will notice that it behaves the same as your unnamed example: here you cannot do abc::mysort(vec, 1, 2, 3) , but you can using namespace abc; mysort(vec, 1, 2, 3) using namespace abc; mysort(vec, 1, 2, 3) .
This is because there are no two abc::mysort s, only a abc::def::mysort and abc::mysort . When you declared the actual abc::mysort , it hides the one that was added using namespace def . Note that if you comment out 1-param mysort , you can say abc::mysort(vec, 1, 2, 3) .
Since it was hidden, a qualified call to abc::mysort must explicitly specify abc::mysort and only finds a version with 1 parameter.
However, if an unqualified call is made using namespace abc; mysort(vec, 1, 2, 3) using namespace abc; mysort(vec, 1, 2, 3) it can use ADL to search for any available function that matches.