https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65659
Bug ID: 65659 Summary: STL containers not specialized for pointer value_type Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: marc at kdab dot com The STL containers are not specialised for pointer types, leading to tons of duplicated virtually-identical binary code. Example: vector<const T*> could be implemented in terms of vector<T*> vector<T*> could be implemented in terms of vector<void*> vector<shared_ptr<const T>> could be implemented in terms of vector<shared_ptr<T>> vector<chared_ptr<T>> could be implemented in terms of vector<shared_ptr<void>> Is there anything that prevents this rather obvious optimisation? Allcators having the wrong type?