namespace { void NeverCalled() { Do = EraseAll; } }
Results in warning: unused function NeverCalled.
In general this is best practice for functions defined and used in a single translation unit.
You could hypothetically link this compilation unit against another unit which included:
void NeverCalled(); struct A { A() { NeverCalled(); } }; A a;
Results in warning: unused function NeverCalled.
In general this is best practice for functions defined and used in a single translation unit.