Template method to select between functions based on accessibility of constructor
I am writing a class ptr_scope_manager to manage the creation and destruction of pointers in a given scope. I have studied the answers from this question: Private constructor inhibits use of emplace[_back]() to avoid a move And it appears that if I want to manage the creation of an object whose class has a private constructor, my internal std::vector can use push_back but not emplace_back to construct the object. This is because emplace_back uses an internal class to construct the object. That means friending the ptr_scope_manager is not sufficient to allow it to create objects with private