AW: [std-proposals] Translation-unit-local functions that access private class fields Hi André,
I think you got the point itself.
As Thiago pointed out, it does not have to be necessarily templates.
It probably is enough, if the member function is defined inside the header file, e.g. directly within the declaration of the class or marked as inline.
Then overload resolution could differ even for calls (to private member functions) within the class.
Currently there are already possible ODR violations for calls outside the class, if a different (e.g. free) function is called.
Internal linkage, which should protect the class encapsulation could give the wrong picture about those private extension functions. Shifting the image from unique and declared upfront per class to declared per TU and not only private in the class, but also exclusive to the TU.
The mental picture should still be that all private functions are clearly separate from each other (even over several TUs). And if they have the same name/signature, then they should not be called by any of the functions defined in a header file: templates, functions defined in the declaration and inlined functions.