By giving it distinct name from the completely unrelated private virtual f
.
Having an overloaded function where different overloads have different access control level neither works nor makes sense. You should only use the same name if the functions actually do the same (or comparable given the arguments) thing, but than it does not make sense to make one public and one private.
If you have a public wrapper over private virtual (which is common, see e.g. std::basic_streambuf
), just add suitable prefix/suffix to one of them (std::basic_streambuf
uses pub
on the public, but it usually makes more sense to add priv
, impl
or _
to the private virtual.